0

I created a reactjs project using the command npx create-react-app project-name and hit the command npm start and finally I got the below error not able to resolve

events.js:187
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
←[90m    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)←[39m
←[90m    at onErrorNT (internal/child_process.js:456:16)←[39m
←[90m    at processTicksAndRejections (internal/process/task_queues.js:80:21)←[39m
Emitted 'error' event on ChildProcess instance at:
←[90m    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)←[39m
←[90m    at onErrorNT (internal/child_process.js:456:16)←[39m
←[90m    at processTicksAndRejections (internal/process/task_queues.js:80:21)←[39m {
  errno: ←[32m'ENOENT'←[39m,
  code: ←[32m'ENOENT'←[39m,
  syscall: ←[32m'spawn cmd'←[39m,
  path: ←[32m'cmd'←[39m,
  spawnargs: [ ←[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! sample-app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sample-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\My Dell\AppData\Roaming\npm-cache\_logs\2019-11-16T05_08_04_473Z-debug.log

Initially, I use to create react project at that time there was no problem but recently it started throwing the same error whenever i create the project

venkatesh
  • 37
  • 9

3 Answers3

0

Try cleaning the npm cache npm cache clean --force

And then do an npm install again.

PragJh
  • 41
  • 1
  • 4
0

Run this command once

npm install react-scripts
Jitesh Prajapati
  • 2,533
  • 4
  • 29
  • 51
0

try reinstalling node.js. Sometimes it works.