登录
    Technology changes quickly but people's minds change slowly.

npm 运行项目报磁盘空间不足 ENOSPC

javaweb笔记 破玉 4328次浏览 0个评论

在自己的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! [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/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
喜欢 (8)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址