使用pm2运行咖啡代码时出错:错误:生成/usr/local/lib/node_modules/pm2/node_modules/.bin/coffee ENOENT

时间:2019-04-04 11:51:30

标签: coffeescript pm2

将pm2从2.1.5升级到3.4.1后,当我尝试启动/重新启动应用程序pm2 restart api时开始出现以下错误:

PM2      | App [api:6] starting in -fork mode-
PM2      | App [api:6] online
PM2      | Error: spawn /usr/local/lib/node_modules/pm2/node_modules/.bin/coffee ENOENT
PM2      |     at Process.ChildProcess._handle.onexit (internal/child_process.js:247:19)
PM2      |     at onErrorNT (internal/child_process.js:431:16)
PM2      |     at processTicksAndRejections (internal/process/task_queues.js:81:17)
PM2      | App [coffee:10] exited with code [0] via signal [SIGINT]

我尝试使用pm2 install coffee为pm2安装咖啡,但这没有帮助-我在pm2 logs中看到了很多:

PM2      | App [coffee:11] exited with code [0] via signal [SIGINT]
PM2      | App [coffee:11] starting in -fork mode-
PM2      | App [coffee:11] online
PM2      | App [coffee:11] exited with code [0] via signal [SIGINT]
PM2      | App [coffee:11] starting in -fork mode-
PM2      | App [coffee:11] online

1 个答案:

答案 0 :(得分:0)

要为pm2安装coffeescript版本1

pm2 install coffee-script

要运行coffeescript版本2,请运行

pm2 install coffeescript