本文介绍了为什么我在创建 React 应用程序时出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新手,想学习 ReactJS,我开始使用 npx create-react-app .
命令安装一个新的空文件夹.我有 npm v.6.4.1.当我尝试执行命令时,它给了我一个错误.
I was new and want to learn ReactJS and I start to install a new empty folder with npx create-react-app .
command. I have npm v.6.4.1. and when I try to execute the command, it gave me an error.
Error: EPERM: operation not permitted, mkdir 'C:UsersLOGIVAR'
TypeError: Cannot read property 'get' of undefined
at errorHandler (C:Program Files
odejs
ode_modules
pmlibutilserror-handler.js:205:18)
at C:Program Files
odejs
ode_modules
pmin
pm-cli.js:78:20
at cb (C:Program Files
odejs
ode_modules
pmlib
pm.js:228:22)
at C:Program Files
odejs
ode_modules
pmlib
pm.js:266:24
at C:Program Files
odejs
ode_modules
pmlibconfigcore.js:83:7
at Array.forEach (<anonymous>)
at C:Program Files
odejs
ode_modules
pmlibconfigcore.js:82:13
at f (C:Program Files
odejs
ode_modules
pm
ode_modulesonceonce.js:25:25)
at afterExtras (C:Program Files
odejs
ode_modules
pmlibconfigcore.js:173:20)
at C:Program Files
odejs
ode_modules
pm
ode_modulesmkdirpindex.js:47:53
C:Program Files
odejs
ode_modules
pmlibutilserror-handler.js:205
if (npm.config.get('json')) {
^
TypeError: Cannot read property 'get' of undefined
at process.errorHandler (C:Program Files
odejs
ode_modules
pmlibutilserror-handler.js:205:18)
at process.emit (events.js:182:13)
at process._fatalException (internal/bootstrap/node.js:485:27)
Install for create-react-app@latest failed with code 7
我已经在 Laravel 空项目上执行了相同的命令,但我仍然给我同样的错误.
I already do the same command on Laravel empty project, but I still gives me the same error.
你能告诉我问题的主要原因是什么以及如何解决这个问题吗?
Can you tell me what's the main cause problem and how to fix this?
我已经以管理员身份运行终端,但我收到另一个错误:
I already run the terminal as administrator, but I receive another error:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "2AppDataRoaming
pm-cache\_npx10552" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersLOGIVAR TY 2AppDataRoaming
pm-cache\_logs2019-01-23T04_18_56_036Z-debug.log
Install for create-react-app@latest failed with code 1
推荐答案
您是否尝试以管理员身份运行此程序?
Have you tried running this as admin?
这篇关于为什么我在创建 React 应用程序时出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!