I am downloading react js with npm , but I am getting this error again and again. Can any give me solution.I have tried multiple times but it is still giving me same error.
C:\\react\\todo>npm start
> 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.
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
You should use npx create-react-app appname
this is from 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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.