0

I have created a Simple React App and succeed because it already showed the happy hacking message on cmd, however when i type and ran "npm start" on cmd it gives a lot of errors. I've tried to uninstall then install the node and npm several times but it still doesn't work. here's the error message

Creating a new React app in C:\myapp2.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...


> [email protected] postinstall C:\myapp2\node_modules\babel-runtime\node_modules\core-js
> node postinstall || echo "ignore"


> [email protected] postinstall C:\myapp2\node_modules\core-js
> node scripts/postinstall || echo "ignore"

+ [email protected]
+ [email protected]
+ [email protected]
added 1475 packages from 693 contributors and audited 904933 packages in 828.526s
found 0 vulnerabilities


Success! Created myapp2 at C:\myapp2
Starting the development server...

events.js:187
      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:80:21)
Emitted 'error' event on ChildProcess instance 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:80:21) {
  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! [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\2019-11-13T21_57_29_371Z-debug.log

I hope you guys can help me to point out where i should make changes so it can work successfully. thanks in advance !

1
  • Have you tried nuking the node_modules folder and installing again? rmdir ./node_modules and npm install. Also, what node version are you on? node -v Commented Nov 13, 2019 at 22:23

2 Answers 2

2

after creating a project with create-react-app

create-react-app name

you have to go inside the created folder

cd name

and then run

npm start

again

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

Comments

0

first create a folder in one Drive( D: or E:),open it in command prompt and create a react app like:

npm create-react-app project name

or

npx-create-react-app project name cd project name npm start

Comments

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.