0

Early in the project that I am working at right now, I had to run npm run eject so that I could change where my /build folder would get generated so that the back-end could serve its contents.

In order to do this, first I modified the paths.js by changing the buildPath variable to my desired location.

Then I modified the webpack.config.js file by adding a filename property in the HtmlWebpackPlugin object inside plugins, to point to the build index.html. Also inside this same folder, I removed the /static start substring from everything that appeared in the file.

Lastly, I added a homepage property in package.json to point to my /static folder generated from build.

The production is working fine, but I am unable to start the development server now with this new configuration. Whenever I try to run npm start, it logs

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

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/ccaon/hpcc-projects/hpcc-app-list/public'
    at FSWatcher.<computed> (internal/fs/watchers.js:218:26)
    at Object.watch (fs.js:1582:34)
    at createFsWatchInstance (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:429:19)
    at FSWatcher.<anonymous> (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:477:19)
    at FSWatcher.<anonymous> (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:482:16)
    at FSReqCallback.oncomplete (fs.js:193:5)
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:40:5)
    at setFsWatchListener (/home/ccaon/hpcc-projects/hpcc-app-list/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    [... lines matching original stack trace ...]
    at FSReqCallback.oncomplete (fs.js:193:5) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/ccaon/hpcc-projects/hpcc-app-list/public',
  filename: '/home/ccaon/hpcc-projects/hpcc-app-list/public'
Caon
  • 1
  • 3
  • may be related: https://stackoverflow.com/questions/55763428/react-native-error-enospc-system-limit-for-number-of-file-watchers-reached – Yaroslav Sep 29 '21 at 14:12

0 Answers0