有没有办法grunt serve
使用 PM2 运行?这样我可以将我的环境设置为在我的计算机启动时自动启动。
我发现了类似的东西:
cd /path/to/project/
pm2 start grunt --name website -- serve
但这似乎不起作用。查看时出现以下错误pm2 logs
:
PM2: 2015-10-19 18:23:44: Script C:\Users\...\AppData\Roaming\npm\grunt had too many unstable restarts (15). Stopped. "errored"
grunt-0 (err): at Module._compile (module.js:413:25)
grunt-0 (err): at Object.Module._extensions..js (module.js:452:10)
grunt-0 (err): at Module.load (module.js:355:32)
grunt-0 (err): at Function.Module._load (module.js:310:12)
grunt-0 (err): at Function._load (C:\Users\cltessie\AppData\Roaming\npm\node_modules\pm2\node_modules\pmx\lib\transaction.js:62:21)
grunt-0 (err): at Object.<anonymous> (C:\Users\cltessie\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:28:21)
grunt-0 (err): at Module._compile (module.js:434:26)
grunt-0 (err): at Object.Module._extensions..js (module.js:452:10)
grunt-0 (err): at Module.load (module.js:355:32)
grunt-0 (err): SyntaxError: Unexpected token case
grunt-0 (err): at exports.runInThisContext (vm.js:53:16)
grunt-0 (err): at Module._compile (module.js:413:25)
grunt-0 (err): at Object.Module._extensions..js (module.js:452:10)
grunt-0 (err): at Module.load (module.js:355:32)
grunt-0 (err): at Function.Module._load (module.js:310:12)
grunt-0 (err): at Function._load (C:\Users\cltessie\AppData\Roaming\npm\node_modules\pm2\node_modules\pmx\lib\transaction.js:62:21)
grunt-0 (err): at Object.<anonymous> (C:\Users\cltessie\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:28:21)
grunt-0 (err): at Module._compile (module.js:434:26)
grunt-0 (err): at Object.Module._extensions..js (module.js:452:10)
grunt-0 (err): at Module.load (module.js:355:32)