YARN START gives no space left on device error

5.2k views Asked by At

OS : UBUNTU 18.04

I created a simple create-react-app project then fired up a server using yarn start. 30% of the times it works fine but 70% of the times I get the following error.

Starting the development server...

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

Error: ENOSPC: no space left on device, watch '/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/public'
    at FSWatcher.start (internal/fs/watchers.js:164:26)
    at Object.watch (fs.js:1232:11)
    at createFsWatchInstance (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:232:14)
    at FSWatcher.NodeFsHandler._handleDir (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:414:19)
    at FSWatcher.<anonymous> (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:462:19)
    at FSWatcher.<anonymous> (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:467:16)
    at FSReqWrap.oncomplete (fs.js:155:5)
Emitted 'error' event at:
    at FSWatcher._handleError (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:39:5)
    at setFsWatchListener (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    [... lines matching original stack trace ...]
    at FSReqWrap.oncomplete (fs.js:155:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I'm clueless on how this error comes up. I have literally nothing stored on my laptop and around 90% Harddisk is free. The working directory has nearly 200+ GB free space. I also tried starting the project by copying the entire project into different locations(different drives too) but none worked. Also, tried npm start but that too did not work.

3

There are 3 answers

3
Kamil Dzieniszewski On

You need to check your Node.js version.

As documentation say You’ll need to have Node >= 6 on your local development machine

2
krisaoe On

Try removing your node_modules folder, then using NPM to install ('npm i') and run ('npm run start'), instead of Yarn. I received the same error, preventing me from running my Node project using Yarn. I tried Node v10.10.0 and v8.12.0. Removing my node_modules folder and reinstalling with Yarn did not help.

1
Jida On

I had a similar issue. Solved it by increasing the number of inotify watches. using assistance here: https://github.com/parcel-bundler/parcel/issues/1427 https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

By using: sudo sysctl fs.inotify.max_user_watches=999999999 and persisted using:

echo fs.inotify.max_user_watches=999999999 | sudo tee -a /etc/sysctl.conf 
sudo sysctl --system