[英]I am trying to download React js, but I am getting this error again and again?
I am downloading react js with npm , but I am getting this error again and again. 我正在使用npm下载react js,但是一次又一次出现此错误。 Can any give me solution.I have tried multiple times but it is still giving me same error. 任何可以给我解决方案。我已经尝试了多次,但仍然给我同样的错误。
C:\\react\\todo>npm start C:\\ react \\ todo> npm开始
> todo@0.1.0 start C:\react\todo
> react-scripts start
Starting the development server...
events.js:180
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:3000/' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! todo@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the todo@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\HAROON & ABDULREHMAN\AppData\Roaming\npm-cache\_logs\2019-08-28T21_27_54_711Z-debug.log
After some research, I found this. 经过研究,我发现了这一点。
I(tylerlaberge) ran into this exact issue as well and found that it is only present with react-scripts@3.0.0, downgrading to react-scripts@2.1.8 resolved the issue without needing to mess with environment variables. 我(tylerlaberge)也遇到了这个确切的问题,发现它仅在react-scripts@3.0.0中存在,降级到react-scripts@2.1.8解决了该问题,而无需弄乱环境变量。
create-react-app my-app
cd my-app
npm install react-scripts@2.1.8
npm start
https://github.com/facebook/create-react-app/issues/6985#issuecomment-490319841 https://github.com/facebook/create-react-app/issues/6985#issuecomment-490319841
You should use npx create-react-app appname
this is from react docs https://reactjs.org/docs/create-a-new-react-app.html . 您应该使用npx create-react-app appname
该名称来自react docs https://reactjs.org/docs/create-a-new-react-app.html 。 I use to have a lot of problems when I used npm create-react-app
, they all went away when I stated using npx. 当我使用npm create-react-app
时,我经常遇到很多问题,当我说使用npx时,它们都消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.