question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm start not working events.js174 throw er; //Unhandled 'error' event

See original GitHub issue

Is 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:)

  1. cd my-app 2, npm start

  2. create-react-app my-app

  3. cd my-app

  4. npm start

or

  1. create-react-app my-app
  2. cd my-app
  3. 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: Capture1

when starting a newly created react app Capture

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

https://github.com/NickCalderone/maze

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

8reactions
tylerlabergecommented, May 8, 2019

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.

create-react-app my-app
cd my-app
npm install react-scripts@2.1.8
npm start
1reaction
BinojBIcommented, May 13, 2019

I felt in same problem. Thank you @tylerlaberge it worked for me…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node events.js:167 throw er; // Unhandled 'error' event
I had the same issue I ran killall node then npm start after that my local server at port 5000 worked again.
Read more >
How to Fix “throw er; // Unhandled 'error' event”? - Medium
Try to install above npm package. It has resolved my issue. If it doesn't help then it may be cache problem. You can...
Read more >
npm start not working events.js174 throw er - LaReact Js
js174 throw er ; //Unhandled 'error' event. Hello Everyone,. I am create a react app with the command which is provided from react...
Read more >
How to Fix "throw er; // Unhandled 'error' event"?
npm run watch fails with a rather cryptic "throw er; // Unhandled 'error' event". Here is how I resolved it.
Read more >
events.js:174 [0] throw er; // Unhandled &#38;#039;err
Failed at the mdbreact@4.27.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found