anita shrivastava
anita shrivastava

Reputation: 329

npm start throwing error when trying to create a react app

I am new to web development using react. So, i did the following - npm install -g create-react-app create-react-app my-app cd my-app npm start

But, it is throwing a error which are as follows:

E:\Study\React-course\React-app\my-app>npm start

> [email protected] start E:\Study\React-course\React-app\my-app
> react-scripts start

i 「wds」: Project is running at http://192.168.1.5/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from E:\Study\React-course\React-app\my-app\public
i 「wds」: 404s will fallback to /
Starting the development server...

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

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
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\asus\AppData\Roaming\npm-cache\_logs\2020-07-20T07_10_52_845Z-debug.log

E:\Study\React-course\React-app\my-app>

Upvotes: 0

Views: 601

Answers (2)

Ravi Koshti
Ravi Koshti

Reputation: 1

Please do not write a special character on your local system folder

Upvotes: 0

gagangaur
gagangaur

Reputation: 53

Instead of using this (npm install -g create-react-app create-react-app) try creating react app using ( npx create-react-app my-app) And for more clarification follow this https://create-react-app.dev/docs/getting-started/

Upvotes: 1

Related Questions