New to Forge and new to webpack, I have a production server and test server with exactly the same code base on it, one builds fine and the other gives me this error
> [email protected] watch /home/forge/crm.geniusmoney.co.uk
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
Copying resources/assets/img to /home/forge/crm.geniusmoney.co.uk/public/img
0% compiling 10% building modules 0/1 modules 1 active ....uk/resources/assets/sass/custom.scss 10% building modules 1/1 modules 0 active 10% building modules 1/2 modules 1 active ...ney.co.uk/resources/assets/js/main.js 10% building modules 2/2 modules 0 active
Webpack is watching the files…
events.js:183
throw er; // Unhandled 'error' event
^
Error: watch resources/assets/img 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/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleDir (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:407:19)
at FSWatcher.<anonymous> (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/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! [email protected] 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 [email protected] 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/forge/.npm/_logs/2018-04-25T07_29_45_227Z-debug.log
I have tried to remove unused assets and it's not working, any ideas
Are you running the build on the server? It is not necessary to run the build on the server. However, since you are, your npm modules did not install correctly. If you have a choice in deployment methods, build for production and commit to the repo. Then, the build files will already be present in the public directory.