0%

hexo d 時發生 ENOSPC 錯誤

在部屬 hexo 的時候發生錯誤,筆記一下解決方法

1
2
3
4
5
6
7
8
9
10
Error: watch /home/user/Downloads/GitHub/vn7n24fzkq.github.io/themes/next/layout/_macro/wechat-subscriber.swig ENOSPC
at exports._errnoException (util.js:870:11)
at FSWatcher.start (fs.js:1234:19)
at Object.fs.watch (fs.js:1262:11)
at createFsWatchInstance (/home/casper/Downloads/GitHub/vn7n24fzkq.github.io/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/casper/Downloads/GitHub/vn7n24fzkq.github.io/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/casper/Downloads/GitHub/vn7n24fzkq.github.io/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/casper/Downloads/GitHub/vn7n24fzkq.github.io/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher.<anonymous> (/home/casper/Downloads/GitHub/vn7n24fzkq.github.io/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at FSReqWrap.oncomplete (fs.js:82:15)
  • 解決方法
    1
    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
    這行指令可以增加可以觀看的文件數量