欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

vue npm run dev启动报错

程序员文章站 2022-05-13 19:31:27
...
> [email protected] dev /home/haibin/WebstormProjects/vueProject/tabbar
> vue-cli-service serve

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

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/haibin/WebstormProjects/vueProject/tabbar/public'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1258:11)
    at createFsWatchInstance (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/lib/nodefs-handler.js:429:19)
    at FSWatcher.<anonymous> (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/lib/nodefs-handler.js:477:19)
    at FSWatcher.<anonymous> (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/lib/nodefs-handler.js:482:16)
    at FSReqWrap.oncomplete (fs.js:154:5)
Emitted 'error' event at:
    at FSWatcher._handleError (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/lib/nodefs-handler.js:40:5)
    at setFsWatchListener (/home/haibin/WebstormProjects/vueProject/tabbar/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    [... lines matching original stack trace ...]
    at FSReqWrap.oncomplete (fs.js:154:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] dev 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/haibin/.npm/_logs/2019-10-28T12_07_46_419Z-debug.log

1.删除node_modules

npm install

2.关闭编辑器,从新打开项目再重新

npm run dev

如果报错不是这种

可以查看package.json的scripts启动条件是dev还是servevue npm run dev启动报错