在自己的Ubuntu 上运行一段时间npm 就报错:
Error: ENOSPC: no space left on device, watch '/mysoft/www/vue-element-admin/public'
at FSWatcher.start (fs.js:1375:26)
at Object.fs.watch (fs.js:1412:11)
at createFsWatchInstance (/mysoft/www/vue-element-admin/node_modules/chokidar/lib/nodefs-handler.js:38:15)
at setFsWatchListener (/mysoft/www/vue-element-admin/node_modules/chokidar/lib/nodefs-handler.js:81:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/mysoft/www/vue-element-admin/node_modules/chokidar/lib/nodefs-handler.js:233:14)
at FSWatcher.NodeFsHandler._handleDir (/mysoft/www/vue-element-admin/node_modules/chokidar/lib/nodefs-handler.js:429:19)
at FSWatcher. (/mysoft/www/vue-element-admin/node_modules/chokidar/lib/nodefs-handler.js:477:19)
at FSWatcher. (/mysoft/www/vue-element-admin/node_modules/chokidar/lib/nodefs-handler.js:482:16)
at FSReqWrap.oncomplete (fs.js:150:5)
Emitted 'error' event at:
at FSWatcher._handleError (/mysoft/www/vue-element-admin/node_modules/chokidar/index.js:260:10)
at createFsWatchInstance (/mysoft/www/vue-element-admin/node_modules/chokidar/lib/nodefs-handler.js:40:5)
at setFsWatchListener (/mysoft/www/vue-element-admin/node_modules/chokidar/lib/nodefs-handler.js:81:15)
[... lines matching original stack trace ...]
at FSReqWrap.oncomplete (fs.js:150:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-element-admin@4.0.1 dev: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-element-admin@4.0.1 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/xiaoduc/.npm/_logs/2019-06-23T13_09_22_007Z-debug.log
查看了磁盘空间都是很足的哇
终于在stackoverflow 上找到原因
解决办法
查看目前的最大值
To find your current limit, type this in your terminal:
$cat /proc/sys/fs/inotify/max_user_watches
增加最大值
Which is typically 8192 by default.
To increase your limit, type this:
$sudo sysctl fs.inotify.max_user_watches=16384
永久设置最大值
Then restart django.
To permanently set this limit, type this:
$echo 16384 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
华裳绕指柔, 版权所有丨如未注明 , 均为原创|转载请注明npm 运行项目报磁盘空间不足 ENOSPC!