4

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

1

1 Answer 1

9

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
Sign up to request clarification or add additional context in comments.

2 Comments

It modifies the maximum number of files that can be watched. I don't know exactly why it's an issue to begin with. I assume npm run serve is watching the entire directory. And if you're using npm, that's A LOT of files because of the node_modules directory.
Thank you, you save my life jajaja

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.