Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error running npm run serve on new vue project

I made this:

vue create myfirstapp 
atom (for open my editor)
cd myfirst app
npm run serve 

and I get this

> [email protected] serve /home/paolinsky/Documentos/vueBasico/fazt/myfirstapp
> vue-cli-service serve

 INFO  Starting development server...
10% building 2/2 modules 0 activeevents.js:196
      throw er; // Unhandled 'error' event
      ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/public'
    at FSWatcher.<computed> (internal/fs/watchers.js:168:26)
    at Object.watch (fs.js:1351:34)
    at createFsWatchInstance (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/lib/nodefs-handler.js:429:19)
    at FSWatcher.<anonymous> (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/lib/nodefs-handler.js:477:19)
    at FSWatcher.<anonymous> (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/lib/nodefs-handler.js:482:16)
    at FSReqCallback.oncomplete (fs.js:165:5)
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/lib/nodefs-handler.js:40:5)
    at setFsWatchListener (/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    [... lines matching original stack trace ...]
    at FSReqCallback.oncomplete (fs.js:165:5) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/public',
  filename: '/home/paolinsky/Documentos/vueBasico/fazt/myfirstapp/public'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] serve 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/paolinsky/.npm/_logs/2019-12-15T15_13_50_223Z-debug.log

This always happen in all my vue projects, included the new ones.

My versions are: npm: 6.13.4 node: v13.3.0

I'm running Ubuntu 18.04 on an asus vivobook laptop 4gb ram, Intel core I3 7th gen

like image 289
Paolo Donato Navarro Avatar asked Dec 31 '22 10:12

Paolo Donato Navarro


1 Answers

I ran into this same problem recently. I solved it like this:

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

cat /proc/sys/fs/inotify/max_user_watches

fs.inotify.max_user_watches=524288
like image 102
Matt U Avatar answered Jan 03 '23 00:01

Matt U