Create-react-app: npm start failed to start App

Created on 25 Apr 2019  路  27Comments  路  Source: facebook/create-react-app

Hello Folks,

I am having this issue from yesterday, When I am trying to create new app with create-react-app and trying to start it thorwing below error. Though old apps are still running. Please help me in this as I have already tried all solutions available on stackoverflow and issue list.

OS: WIN 7,
NODE : 10.15.0
NPM: 6.4.1

Error On Cmd:

Starting the development server...

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

Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.

with Verboose :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Devloper\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:\Users\Devloper\AppData\Roaming\npmnode_modules\npmnode_modules\npm-lifecycle\node-gyp-bin;D:\react\NoteTakingApp\testappnode_modules.bin;C:\Program Files\nodejs\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Java\jdk1.8.0_171\bin;C:\Users\Devloper\AppData\Roaming\npm
9 verbose lifecycle [email protected]~start: CWD: D:\react\NoteTakingApp\testapp
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: react-scripts start
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Users\Devloper\AppData\Roaming\npmnode_modules\npmnode_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess. (C:\Users\Devloper\AppData\Roaming\npmnode_modules\npmnode_modules\npm-lifecycle\libspawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd D:\react\NoteTakingApp\testapp
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Devloper\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v10.15.1
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: react-scripts start
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

low (ignored issue template) stale

Most helpful comment

Was helping someone with this problem on their Windows box and came across the following SO article and it did the trick.

I checked system variables one more time and found the cause of the problem: missing C:\Windows\System32\ variable. I added it and that solved my problem

More detailed instructions that didn't get labeled as the answer:

Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.

Took a fair amount of Googling to arrive there. Hopefully this helps people out so they aren't forced to try a particular, now outdated, version of react-scripts just to get their React app running.

All 27 comments

@aparna-github Please Follow the Issue

Please fill out the issue template so we can help.

I have same or very simmilar issue after upgrading my app to CRA 3.0

In console I can see the build was compilled successfully but it crashes right after.

C:\Users\pospi\Documents\ers-app\client>npm start

> [email protected] start C:\Users\pospi\Documents\ers-app\client
> react-scripts start
Starting the development server...
Compiled successfully!

You can now view ers-app in the browser.

  Local:            http://localhost:3000/
  On Your Network:  http://192.168.56.1:3000/

Note that the development build is not optimized.
To create a production build, use npm run build.



#
# Fatal error in , line 0
# Check failed: U_SUCCESS(status).
#
#
#
#FailureMessage Object: 000000A087B9DF90npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 3221225477
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\pospi\AppData\Roaming\npm-cache\_logs\2019-04-28T07_51_34_996Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\pospi\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:\Users\pospi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\pospi\Documents\ers-app\client\node_modules\.bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\dotnet\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\nodejs\;C:\Users\pospi\AppData\Local\Microsoft\WindowsApps;C:\Program Files\heroku\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\pospi\AppData\Roaming\npm
9 verbose lifecycle [email protected]~start: CWD: C:\Users\pospi\Documents\ers-app\client
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle [email protected]~start: Returned: code: 3221225477  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `react-scripts start`
13 verbose stack Exit status 3221225477
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\pospi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:196:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\pospi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:196:13)
13 verbose stack     at maybeClose (internal/child_process.js:1000:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\pospi\Documents\ers-app\client
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\pospi\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.0.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 3221225477
22 error [email protected] start: `react-scripts start`
22 error Exit status 3221225477
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225477, true ]

I have the same issue when creating a new react app:

````
Starting the development server...

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

Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
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.
````

Same here!

If anyone is using Node.js 12.0.0, try to upgrade to 12.1.0. For me it is now working.

Still Having Issue, any Help. @pospichalales I am using node 10.15.0.

Similar error here
`Starting the development server...

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

Error: spawn /usr/bin/chromium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:247:19)
at onErrorNT (internal/child_process.js:429:16)
at processTicksAndRejections (internal/process/task_queues.js:81:17)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:253:12)
at onErrorNT (internal/child_process.js:429:16)
at processTicksAndRejections (internal/process/task_queues.js:81:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
`
I have fixed it by using

EDITED
"react-scripts": "2.1.8" instead of "react-scripts": "3.0.0"

@florin1000 sorry, But "react-scripts": "2.1.8" instead of "react-scripts": "2.1.8" makes no sense to me. Can you assist me better. Though I get it fixed by reinstalling os on my system. But still wants to know the solution and cause, if any.

Sorry, I have updated my answer.
1)remove node_modules and lock files
2)edit package.json so the new version of react-scripts is "2.1.8"
3)yarn install / npm install
4)cd _your-app_
5)yarn start / npm start

Sorry, I have updated my answer.
1)remove node_modules and lock files
2)edit package.json so the new version of react-scripts is "2.1.8"
3)yarn install / npm install
4)cd _your-app_
5)yarn start / npm start

This works, but it is just a workaround. It seems indicative of a larger issue in one of these packages. Please keep this issue open.

Worked for me. Thanks!
1)remove node_modules and lock files
2)edit package.json so the new version of react-scripts is "2.1.8"
3)yarn install / npm install
4)cd your-app
5)yarn start / npm start

same here

$ npm start

[email protected] start D:\web-dev06_react\npxmy-app
react-scripts start
Starting the development server...

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

Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
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\RAFA\AppData\Roaming\npm-cache_logs\2019-05-04T16_46_21_179Z-debug.log

It worked for me as well! Thanks a lot!
1)edit package.json so the new version of react-scripts is "2.1.8"
2) npm install
3)cd your-app
4)npm start

Sorry, I have updated my answer.
1)remove node_modules and lock files
2)edit package.json so the new version of react-scripts is "2.1.8"
3)yarn install / npm install
4)cd _your-app_
5)yarn start / npm start

this works but why on earth must we do this? what is the actuall issue?! I want to use react-scripts 3.1.0 because it many new features. Besides doing this for every single React app is pain in the ass. I'd definitely appreciate a permanent solution to this. Any ideas?

Was helping someone with this problem on their Windows box and came across the following SO article and it did the trick.

I checked system variables one more time and found the cause of the problem: missing C:\Windows\System32\ variable. I added it and that solved my problem

More detailed instructions that didn't get labeled as the answer:

Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.

Took a fair amount of Googling to arrive there. Hopefully this helps people out so they aren't forced to try a particular, now outdated, version of react-scripts just to get their React app running.

Was helping someone with this problem on their Windows box and came across the following SO article and it did the trick.

I checked system variables one more time and found the cause of the problem: missing C:\Windows\System32\ variable. I added it and that solved my problem

More detailed instructions that didn't get labeled as the answer:

Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.

Took a fair amount of Googling to arrive there. Hopefully this helps people out so they aren't forced to try a particular, now outdated, version of react-scripts just to get their React app running.

Thank you! This worked for me! I am now using react-scripts version 3.0.1 successfully.

can u help me to solve this issue
I try both ways but didnt work for me

I fixed it changing BROWSER environment variable. I had BROWSER=chromium in my .zshrc (.bashrc too). If you are using Linux, set BROWSER environment variable to your browser executable: BROWSER=google-chrome-stable,BROWSER=firefox, etc.

Also you can specify it before running yarn start:
BROWSER=firefox yarn start

Was helping someone with this problem on their Windows box and came across the following SO article and it did the trick.

I checked system variables one more time and found the cause of the problem: missing C:\Windows\System32\ variable. I added it and that solved my problem

More detailed instructions that didn't get labeled as the answer:

Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.

Took a fair amount of Googling to arrive there. Hopefully this helps people out so they aren't forced to try a particular, now outdated, version of react-scripts just to get their React app running.

Thanks a lot for this suggestion! It worked for me!

@creativetim This comment-488993043 helps me to fix the issue by downgrading react-scripts version. but I want to use the latest version.

Seems like your answer works for windows. but I am on Linux.
Do you know how to fix it in on Linux.?

@harsha-sira, I'm on OSX and was helping a friend on a Windows box. If the issue is an environment variable perhaps that's all that needs to be created, but I'm not sure what the analogous path would be for you. Sorry.

If you-re running on windows(my case been window 10), including the path "C:/Windows/System32;" should resolve the issue.
All you have to do is type in 'env' in the search bar, navigate to environment variables.
Then check the paths for the "C:/Windows/System32", if you cant find it, include it and restart your system. This should resolve it.

Was helping someone with this problem on their Windows box and came across the following SO article and it did the trick.

I checked system variables one more time and found the cause of the problem: missing C:\Windows\System32\ variable. I added it and that solved my problem

More detailed instructions that didn't get labeled as the answer:

Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.

Took a fair amount of Googling to arrive there. Hopefully this helps people out so they aren't forced to try a particular, now outdated, version of react-scripts just to get their React app running.

This worked for me too! Thanks

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings