facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.5k stars 26.77k forks source link

npm start failed to start App #6908

Closed rakeshjha1993 closed 4 years ago

rakeshjha1993 commented 5 years ago

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 npm@6.9.0 3 info using node@v10.15.1 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle testapp@0.1.0~prestart: testapp@0.1.0 6 info lifecycle testapp@0.1.0~start: testapp@0.1.0 7 verbose lifecycle testapp@0.1.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle testapp@0.1.0~start: PATH: C:\Users\Devloper\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\react\NoteTakingApp\testapp\node_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 testapp@0.1.0~start: CWD: D:\react\NoteTakingApp\testapp 10 silly lifecycle testapp@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ] 11 silly lifecycle testapp@0.1.0~start: Returned: code: 1 signal: null 12 info lifecycle testapp@0.1.0~start: Failed to exec start script 13 verbose stack Error: testapp@0.1.0 start: react-scripts start 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (C:\Users\Devloper\AppData\Roaming\npm\node_modules\npm\node_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\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.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 testapp@0.1.0 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 testapp@0.1.0 start: react-scripts start 22 error Exit status 1 23 error Failed at the testapp@0.1.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

rakeshjha1993 commented 5 years ago

@aparna-github Please Follow the Issue

ianschmitz commented 5 years ago

Please fill out the issue template so we can help.

pospichalales commented 5 years ago

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

> ers-app@3.0.0 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! ers-app@3.0.0 start: `react-scripts start`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the ers-app@3.0.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\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 npm@6.9.0
3 info using node@v12.0.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle ers-app@3.0.0~prestart: ers-app@3.0.0
6 info lifecycle ers-app@3.0.0~start: ers-app@3.0.0
7 verbose lifecycle ers-app@3.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle ers-app@3.0.0~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 ers-app@3.0.0~start: CWD: C:\Users\pospi\Documents\ers-app\client
10 silly lifecycle ers-app@3.0.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle ers-app@3.0.0~start: Returned: code: 3221225477  signal: null
12 info lifecycle ers-app@3.0.0~start: Failed to exec start script
13 verbose stack Error: ers-app@3.0.0 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 ers-app@3.0.0
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 ers-app@3.0.0 start: `react-scripts start`
22 error Exit status 3221225477
23 error Failed at the ers-app@3.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225477, true ]
JaredZena commented 5 years ago

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! myapp@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myapp@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
marcelodmdo commented 5 years ago

Same here!

pospichalales commented 5 years ago

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

rakeshjha1993 commented 5 years ago

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

florin1000 commented 5 years ago

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"

rakeshjha1993 commented 5 years ago

@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.

florin1000 commented 5 years ago

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

markfonte commented 5 years ago

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.

JaredZena commented 5 years ago

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

rafafauzi commented 5 years ago

same here

$ npm start

my-app@0.1.0 start D:\web-dev\06_react\npx\my-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! my-app@0.1.0 start: react-scripts start npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the my-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\RAFA\AppData\Roaming\npm-cache_logs\2019-05-04T16_46_21_179Z-debug.log

angellee0102 commented 5 years ago

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

Rezaavoor commented 5 years ago

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?

creativetim commented 5 years ago

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.

markfonte commented 5 years ago

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.

priaaji-seyanegoro commented 5 years ago

https://github.com/facebook/create-react-app/issues/6908#issuecomment-495064048

Thank you ! This worked for me

myf1996 commented 5 years ago

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

aboglioli commented 5 years ago

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

exit-null commented 5 years ago

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!

harsha-sira commented 5 years ago

@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.?

creativetim commented 5 years ago

@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.

kelvinsekx commented 5 years ago

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.

Ivy-Walobwa commented 5 years ago

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

stale[bot] commented 4 years ago

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.

stale[bot] commented 4 years ago

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.