正常的项目在执行yarn run serve启动时突然报错
10% building 1/1 modules 0 activeevents.js:183
throw er; // Unhandled 'error' event
^
Error: watch /home/qingyuan/vueProject/ant-design-jeecg-vue/public ENOSPC
at _errnoException (util.js:992:11)
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
at createFsWatchInstance (/home/qingyuan/vueProject/ant-design-jeecg-vue/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/qingyuan/vueProject/ant-design-jeecg-vue/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/qingyuan/vueProject/ant-design-jeecg-vue/node_modules/chokidar/lib/nodefs-handler.js:232:14)
at FSWatcher.NodeFsHandler._handleDir (/home/qingyuan/vueProject/ant-design-jeecg-vue/node_modules/chokidar/lib/nodefs-handler.js:414:19)
at FSWatcher.<anonymous> (/home/qingyuan/vueProject/ant-design-jeecg-vue/node_modules/chokidar/lib/nodefs-handler.js:462:19)
at FSWatcher.<anonymous> (/home/qingyuan/vueProject/ant-design-jeecg-vue/node_modules/chokidar/lib/nodefs-handler.js:467:16)
at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ENOSPC& No space left on the device.
ENOSPC:设备上没有剩余空间。
终端输入 df -h 命令查询系统磁盘信息,发现磁盘可用空间还是很多的。这是由于 inotify 的默认值设置导致出现的上面问题,修改默认值即可,
解决方案:终端执行如下两个命令,调整 inotify 监听的目录数量
echo fs.inotify.max_user_watches = 524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
网友评论