1

Starting the development server...

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

Error: watch /home/test/Documents/test/public ENOSPC


      at _errnoException (util.js:1022:11)
        at FSWatcher.start (fs.js:1382:19)
        at Object.fs.watch (fs.js:1408:11)
        at createFsWatchInstance (/home/test/Documents/test/node_modules/chokidar/lib/nodefs-handler.js:38:15)
        at setFsWatchListener (/home/test/Documents/test/node_modules/chokidar/lib/nodefs-handler.js:81:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/oxss-006/Documents/test/node_modules/chokidar/lib/nodefs-handler.js:233:14)
        at FSWatcher.NodeFsHandler._handleDir (/home/test/Documents/test/node_modules/chokidar/lib/nodefs-handler.js:429:19)
        at FSWatcher.<anonymous> (/home/test/Documents/test/node_modules/chokidar/lib/nodefs-handler.js:477:19)
        at FSWatcher.<anonymous> (/home/test/Documents/test/node_modules/chokidar/lib/nodefs-handler.js:482:16)
        at FSReqWrap.oncomplete (fs.js:153:5)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the test@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!     /home/.npm/_logs/2019-09-23T04_38_51_220Z-debug.log

When starting npm i am getting error. Its not running in the browser. How to resolve this? If anyone knows please answer this.

This site can’t be reachedlocalhost refused to connect.
Did you mean http://localhost3000.org/?
Search Google for localhost 3000
ERR_CONNECTION_REFUSED

I am using these versions
node v -v8.10.0
npm - 6.11.3

Thanks.

Hasta Dhana
  • 4,699
  • 7
  • 17
  • 26
Emily
  • 103
  • 1
  • 9

2 Answers2

1

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

Your watch is over, watch are for reloading the app whenever there is something change in code.

Narendra Chouhan
  • 2,291
  • 1
  • 15
  • 24
-1

Run the below command to avoid ENOSPC:

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

For Arch Linux add this line to /etc/sysctl.d/99-sysctl.conf:

fs.inotify.max_user_watches=524288

Then execute:

sysctl --system

Here is the reference link where I found the solution.
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details
Node.js: what is ENOSPC error and how to solve?

Hope this will work for you!