0

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>

2 Answers 2

1

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/

Sign up to request clarification or add additional context in comments.

12 Comments

Is node js installed on your system if yes then what version is it??
I have nodejs v14.5.0 installed
I would suggest you to use LTS(long term support) version -of node js not current version of node js as it might be unstable and might be creating issues.
And also do make sure that you have not changed your installation folder while installing node js and also do check the path variable that is this (C:\Windows\System32) added in your path variable or not. Check this thread github.com/facebook/create-react-app/issues/6950
I solved the issue. The default scripts version is 3.4.1 and it was causing the problem. I installed 2.1.8 and int worked fine. Thanks you alot.
|
0

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

2 Comments

Please provide additional details in your answer. As it's currently written, it's hard to understand your solution.
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.