npm start not working events.js174 throw er; //Unhandled 'error' event
See original GitHub issueIs this a bug report?
yes
Did you try recovering your dependencies?
yes
Which terms did you search for in User Guide?
(Write your answer here if relevant.)
Environment
Environment Info:
System: OS: Windows 10 CPU: (4) x64 Intel® Core™ i5-6200U CPU @ 2.30GHz Binaries: Node: 10.15.3 - C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Not Found Internet Explorer: Not Found npmPackages: react: ^16.8.6 => 16.8.6 react-dom: ^16.8.6 => 16.8.6 react-scripts: 3.0.0 => 3.0.0 npmGlobalPackages: create-react-app: Not Found
Steps to Reproduce
(Write your steps here:)
-
cd my-app 2, npm start
-
create-react-app my-app
-
cd my-app
-
npm start
or
- create-react-app my-app
- cd my-app
- npm start
Expected Behavior
Run the app in development mode Open http://localhost:3000 to view it in the browser
Actual Behavior
when starting my react-app:
when starting a newly created react app
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! maze@0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the maze@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\calde\AppData\Roaming\npm-cache_logs\2019-05-04T18_42_43_606Z-debug.log
log file:
0 info it worked if it ends with ok
1 verbose cli [ ‘C:\Program Files\nodejs\node.exe’,
1 verbose cli ‘C:\Users\calde\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.3
4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
5 info lifecycle maze@0.1.0~prestart: maze@0.1.0
6 info lifecycle maze@0.1.0~start: maze@0.1.0
7 verbose lifecycle maze@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle maze@0.1.0~start: PATH: C:\Users\calde\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\calde\Documents\Media\programming\react\maze\node_modules.bin;C:\Program Files\nodejs;C:\Users\calde\AppData\Roaming\npm;
9 verbose lifecycle maze@0.1.0~start: CWD: C:\Users\calde\Documents\Media\programming\react\maze
10 silly lifecycle maze@0.1.0~start: Args: [ ‘/d /s /c’, ‘react-scripts start’ ]
11 silly lifecycle maze@0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle maze@0.1.0~start: Failed to exec start script
13 verbose stack Error: maze@0.1.0 start: react-scripts start
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\calde\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.<anonymous> (C:\Users\calde\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 maze@0.1.0
15 verbose cwd C:\Users\calde\Documents\Media\programming\react\maze
16 verbose Windows_NT 10.0.17134
17 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Users\calde\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js” “start”
18 verbose node v10.15.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error maze@0.1.0 start: react-scripts start
22 error Exit status 1
23 error Failed at the maze@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 ]
Reproducible Demo
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9
Top GitHub Comments
I ran into this exact issue as well and found that it is only present with react-scripts@3.0.0, downgrading to react-scripts@2.1.8 resolved the issue without needing to mess with environment variables.
I felt in same problem. Thank you @tylerlaberge it worked for me…