error from cmd
I am trying to install react for the first time but I always get an error whenever I run "npm start" or "yarn start"
C:\react\reactjs>npm install -g yarn
C:\Users\UNCLE BIGBAY\AppData\Roaming\npm\yarnpkg -> C:\Users\UNCLE BIGBAY\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
C:\Users\UNCLE BIGBAY\AppData\Roaming\npm\yarn -> C:\Users\UNCLE BIGBAY\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
+ [email protected]
updated 1 package in 2.163s
C:\react\reactjs>npm start
> [email protected] start C:\react\reactjs
> react-scripts start
Starting the development server...
events.js:287
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)[39m
[90m at onErrorNT (internal/child_process.js:469:16)[39m
[90m at processTicksAndRejections (internal/process/task_queues.js:84:21)[39m
Emitted 'error' event on ChildProcess instance at:
[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)[39m
[90m at onErrorNT (internal/child_process.js:469:16)[39m
[90m at processTicksAndRejections (internal/process/task_queues.js:84:21)[39m {
errno: [32m'ENOENT'[39m,
code: [32m'ENOENT'[39m,
syscall: [32m'spawn cmd'[39m,
path: [32m'cmd'[39m,
spawnargs: [ [32m'/s'[39m, [32m'/c'[39m, [32m'start'[39m, [32m'""'[39m, [32m'/b'[39m, [32m'"http://localhost:3000"'[39m ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\UNCLE BIGBAY\AppData\Roaming\npm-cache\_logs\2020-04-23T00_06_27_219Z-debug.log
C:\react\reactjs>
I have tried updating the yarn and even reinstalling it
You could downgrade with help of this script and writing that on your terminal then everything should be work:
create-react-app my-app
cd my-app
npm install [email protected]
npm start
This would definitely work. Thanks ))
I had your same problem. I deleted the node_modules folder and reinstalled using:
npm install
After that all works fine.
I find the solution here https://gitmemory.com/issue/facebook/create-react-app/6985/491604318
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With