[英]Error when I try run a React App with npm start command
I create a new React Project and I try to start it with the command npm start
but I have this error: 我创建了一个新的React Project,并尝试使用命令
npm start
来启动它,但是我npm start
这个错误:
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! primera-app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the primera-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Felipe\AppData\Roaming\npm-cache\_logs\2019-08-11T15_55_25_058Z-debug.log
I try a lot of things but nothing works. 我尝试了很多事情,但没有任何效果。
I had the same problem on Windows about two months ago. 大约两个月前,我在Windows上遇到了同样的问题。 I solved it downgrading
react-scripts
to the version 2.1.8
. 我解决了将
react-scripts
降级到2.1.8
版本的问题。 To do so: 为此:
node_modules
directory. node_modules
目录。 package.json
file to downgrade react-scripts
. package.json
文件以降级react-scripts
。 It should look like this: "react-scripts": "2.1.8"
. "react-scripts": "2.1.8"
。 cd my-app
. cd my-app
。 npm install
. npm install
。 npm start
. npm start
。 If this doesn't work, please check your system variables on Windows and make sure C:\\Windows\\System32\\
variable is set as shown here or here . 如果这不起作用,请在Windows上检查系统变量,并确保按此处或此处所示设置
C:\\Windows\\System32\\
变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.