嘗試使用node2啓動並運行nodejs應用程序。pm2 json config未能正常運行應用程序
我們使用SASS並使用「node-sass-middleware」在文件更改上重建css文件。它一切工作完美,直到pm2開始自動重新啓動應用程序每次sass中間件重建一個css文件...這是我們告訴它做的:
pm2 start app.js --watch 因此,後一些閱讀文檔似乎你可以配置pm2與json文件,它有一個選項「ignore_watch」。
因此,在GitHub上的引導下:https://github.com/Unitech/PM2/blob/master/ADVANCED_README.md#json-app-declaration我們設置一個配置JSON文件仰望如下:
{
"name" : "ourApp",
"script" : "server.js",
"watch" : true,
"ignore_watch" : ["public/css"],
"env": {
"NODE_ENV": "development"
}
}
的問題是,當我們嘗試運行它的PM2日誌吐出1000的日誌錯誤都看着有點像這樣的行:
PM2: 2015-05-09 15:32:00: Error: watch ENOSPC
PM2: at errnoException (fs.js:1024:11)
PM2: at FSWatcher.start (fs.js:1056:11)
PM2: at Object.fs.watch (fs.js:1081:11)
PM2: at createFsWatchInstance (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:24:15)
PM2: at setFsWatchListener (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:47:19)
PM2: at EventEmitter.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:177:15)
PM2: at EventEmitter.NodeFsHandler._handleFile (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:201:8)
PM2: at EventEmitter.<anonymous> (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:353:12)
PM2: at Object.oncomplete (fs.js:107:15)
PM2: 2015-05-09 15:32:00: Error: watch ENOSPC
PM2: at errnoException (fs.js:1024:11)
PM2: at FSWatcher.start (fs.js:1056:11)
PM2: at Object.fs.watch (fs.js:1081:11)
PM2: at createFsWatchInstance (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:24:15)
PM2: at setFsWatchListener (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:47:19)
PM2: at EventEmitter.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:177:15)
PM2: at EventEmitter.NodeFsHandler._handleFile (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:201:8)
PM2: at EventEmitter.<anonymous> (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:353:12)
PM2: at Object.oncomplete (fs.js:107:15)
PM2: 2015-05-09 15:32:00: Process with pid 9155 still not killed, retrying...
PM2: 2015-05-09 15:32:00: Process with pid 9155 still alive after 800ms
得益於以下 答案這似乎是罪魁禍首,顯然在Linux世界ENOSPC意味着沒有雙sk空間剩下..但只有2.1gig在整個dev服務器上使用,總硬盤空間爲25gig,這不成問題。
更進一步,當我們從CLI運行PM2在頂部提到PM2: 2015-05-09 15:32:00: Error: watch ENOSPC
是所有的作品完美...
我們真的需要這個,因爲它是造成混亂的開發團隊一起工作。
是否有其他人遇到此問題?
感謝, 約翰
完全停留在此。 – John