小编woz*_*woz的帖子

pm2 --ignore-watch不起作用

我已经使用pm2一段时间了。最近,我需要在Express4项目中添加一个名为“ actionLog”的自定义日志目录。由于它是一个使用日志文件更新的目录,并且我不希望pm2在日志文件更改时重新启动应用程序,因此我希望pm2忽略监视该目录。将pm2更新为最新版本后,这是我使用的命令:

pm2 start app.js --watch --ignore-watch="actionLog"
Run Code Online (Sandbox Code Playgroud)

我在pm2日志中收到以下错误流:

PM2 Error: watch ENOSPC
PM2     at exports._errnoException (util.js:746:11)
PM2     at FSWatcher.start (fs.js:1172:11)
PM2     at Object.fs.watch (fs.js:1198:11)
PM2     at createFsWatchInstance (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:37:15)
PM2     at setFsWatchListener (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:80:15)
PM2     at EventEmitter.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:228:14)
PM2     at EventEmitter.NodeFsHandler._handleFile (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:255:21)
PM2     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:468:21)
PM2     at FSReqWrap.oncomplete (fs.js:95:15)
PM2 Error: watch ENOSPC
PM2     at exports._errnoException (util.js:746:11)
PM2     at FSWatcher.start (fs.js:1172:11)
PM2     at Object.fs.watch (fs.js:1198:11)
PM2     at createFsWatchInstance (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:37:15)
PM2     at setFsWatchListener (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:80:15)
PM2     at EventEmitter.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:228:14)
PM2     at EventEmitter.NodeFsHandler._handleFile (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:255:21) …
Run Code Online (Sandbox Code Playgroud)

node.js express pm2

5
推荐指数
1
解决办法
5803
查看次数

标签 统计

express ×1

node.js ×1

pm2 ×1