Laravel Mix Browser Sync stopped working on Linux Mint
See original GitHub issueThis problem is occurring on a fresh install. However, I have run the suggested commands (reinstall node/check for elixir etc.) anyway.
- Laravel Mix Version: 1.4.5
- Node Version: 8.6.0
- NPM Version: 5.4.2
- OS: Linux Mint 18 Cinnamon 64-bit
- browser-sync@2.18.13
- browser-sync-webpack-plugin@1.2.0
Description:
When running ‘npm run watch’ the following error is returned:
events.js:182 throw er; // Unhandled ‘error’ event ^
Error: watch app ENOSPC
at _errnoException (util.js:1019:11)
at FSWatcher.start (fs.js:1383:19)
at Object.fs.watch (fs.js:1409:11)
at createFsWatchInstance (/home/simon/Code/exp/testWatch/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/simon/Code/exp/testWatch/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/simon/Code/exp/testWatch/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleDir (/home/simon/Code/exp/testWatch/node_modules/chokidar/lib/nodefs-handler.js:407:19)
at FSWatcher.<anonymous> (/home/simon/Code/exp/testWatch/node_modules/chokidar/lib/nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (/home/simon/Code/exp/testWatch/node_modules/chokidar/lib/nodefs-handler.js:460:16)
at FSReqWrap.oncomplete (fs.js:154:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch 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/simon/.npm/_logs/2017-09-30T22_19_30_813Z-debug.log
Steps To Reproduce:
Install a new Laravel app using ‘laravel new <project-name>’ Run ‘npm install’
Add:
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.browserSync('thephysics.dev');
to webpack.mix.js.
Run ‘npm run watch’ (install extra dependencies the first time) Run ‘npm run watch’ again - see the error described above.
This was working fine last week. It didn’t work on a new project tonight. Having upgraded npm and node it now doesn’t work on any projects (even after reinstalling all node dependencies).
Help!
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
Thanks again @Ruchern - really grateful for your time.
I’ve actually reinstalled Linux Mint in an attempt to solve this thread since and set the swapfile to nearly 15 Gb (twice my RAM). This didn’t work, but I have literally just posted something which did fix it.
It appears to be something to do with the default number of files which can be watched. By increasing that number the process works now.
The solution to this seems to be to increase the number of ‘watches’ the linux system can handle by running this command:
This comes from the following Stack Overflow thread:
https://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc
It doesn’t explain why the problem is only with VS Code (other than assuming that VS code uses a lot of ‘watches’).