gatsby: events.js:182 throw er; // Unhandled 'error' event

After command, gatsby develop (npm run develop) I have got an error. Please, help.

Your site is running at http://localhost:8000 I Your graphql debugger is running at http://localhost:8000/___graphql events.js:182 throw er; // Unhandled ‘error’ event ^

Error: watch /data/home/user/Sasha/Gatsbyjs/node_modules/babel-polyfill/node_modules/core-js/library/fn/array ENOSPC at exports._errnoException (util.js:1024:11) at FSWatcher.start (fs.js:1382:19) at Object.fs.watch (fs.js:1408:11) at createFsWatchInstance (/data/home/user/Sasha/Gatsbyjs/node_modules/chokidar/lib/nodefs-handler.js:37:15) at setFsWatchListener (/data/home/user/Sasha/Gatsbyjs/node_modules/chokidar/lib/nodefs-handler.js:80:15) at FSWatcher.NodeFsHandler._watchWithNodeFs (/data/home/user/Sasha/Gatsbyjs/node_modules/chokidar/lib/nodefs-handler.js:228:14) at FSWatcher.NodeFsHandler._handleDir (/data/home/user/Sasha/Gatsbyjs/node_modules/chokidar/lib/nodefs-handler.js:407:19) at FSWatcher.<anonymous> (/data/home/user/Sasha/Gatsbyjs/node_modules/chokidar/lib/nodefs-handler.js:455:19) at FSWatcher.<anonymous> (/data/home/user/Sasha/Gatsbyjs/node_modules/chokidar/lib/nodefs-handler.js:460:16) at FSReqWrap.oncomplete (fs.js:153:5) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! gatsby-starter-default@1.0.0 develop: gatsby develop npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the gatsby-starter-default@1.0.0 develop 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! /data/home/user/.npm/_logs/2017-08-11T06_20_35_175Z-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 76 (2 by maintainers)

Most upvoted comments

For what it’s worth, I ran npm install npm update and it works again.

This fix for me:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Source: Node.JS Error: ENOSPC

the old “reboot the system” fixed it…

EDIT: I am having this issue again 😕

In my MAC, I ran “killall node” and “yarn start” (or npm start) and everything is fine now.

Your site is running at http://localhost:8000 Try changing your port. Like 3000 or 8080.

app.listen(3000)

My 8080 post was taken, so I got this same error

Closing older issues, please open new issues if you need more help!

events.js:167 throw er; // Unhandled ‘error’ event ^

Error: spawn C:\Program Files\nodejs ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:217:19) at onErrorNT (internal/child_process.js:394:16) at process._tickCallback (internal/process/next_tick.js:174:19) Emitted ‘error’ event at: at Process.ChildProcess._handle.onexit (internal/child_process.js:223:12) at onErrorNT (internal/child_process.js:394:16) at process._tickCallback (internal/process/next_tick.js:174:19) help me resolve the issue getting this error after running ng new command

Changing the port number worked for me

npm install fixed it for me

image

What is this error?!

This is happening to me as well any help tried the above solutions I am on windows.

      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! 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\Taslim\AppData\Roaming\npm-cache\_logs\2019-10-24T21_26_11_139Z-debug.log

I fixed my issue on windows by adding C:\Program Files\nodejs && C:\Windows\System32 to my Systems Variables and restarted my VS Code and its working again. Hope this helps anyone.

After closed the Intellij idea my problem solved.

@juliancorrea thanks man. executing killall node solved my problem, as well

I also got error with chokidar and this error code migrating from a hugo site with nested folders in static after forestry handles assets like this. The linux-specific command for fs worked.

This fix for me:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Source: Node.JS Error: ENOSPC it works for me also

All you have to do is close all other open terminals.

Also in my case I had working through Intellij, and when ever I closed the terminal, i had to make my way back to the folder with the js file.

I have The same error !!

Event.js:292 Throw er; // unhandled ‘error’ event How to solve this error

npm install react-scripts --save

Try to change port no : 3000 to 8080 Working fine. **

app.listen(8080)

**

Had the same issue! Just run sudo npm start instead of npm start and it worked! 😉

I had another node development server running in another terminal, once I closed that this error was fixed.

For what it’s worth, I ran npm install npm update and it works again.

This one worked for me

In my MAC, I ran “killall node” and “yarn start” (or npm start) and everything is fine now.

Yep, it works for me. Thanks, man.

Just change the door, in my case change to 8080 and function

@kw3ku be right, in my case used port 80 i changed to 3000 it running normally now.