由 pm2 运行时出现意外令牌 * 异常 [英] Unexpected token * exception when run by pm2

查看:139
本文介绍了由 pm2 运行时出现意外令牌 * 异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试通过 pm2 启动节点进程时出现以下异常 - 当我直接执行 app.js 时,一切正常.我看到在堆栈跟踪中提到了 pm2 的 node_modules 文件夹 - 为什么?

I get the following exception when trying to start a node process over pm2 - when I execute the app.js directly everything is working just fine. I see that in the stack trace there is the node_modules folder of pm2 mentioned - why is that?

30|MyPm2Process  | /smprod/dev-backend/node_modules/tedious/lib/token/stream-parser.js:60
30|MyPm2Process  |   static async *parseTokens(iterable, debug, options, colMetadata = []) {
30|MyPm2Process  |                ^
30|MyPm2Process  | SyntaxError: Unexpected token *
30|MyPm2Process  |     at createScript (vm.js:80:10)
30|MyPm2Process  |     at Object.runInThisContext (vm.js:139:10)
30|MyPm2Process  |     at Module._compile (module.js:616:28)
30|MyPm2Process  |     at Object.Module._extensions..js (module.js:663:10)
30|MyPm2Process  |     at Module.load (module.js:565:32)
30|MyPm2Process  |     at tryModuleLoad (module.js:505:12)
30|MyPm2Process  |     at Function.Module._load (module.js:497:3)
30|MyPm2Process  |     at Module.require (module.js:596:17)
30|MyPm2Process  |     at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
30|MyPm2Process  |     at require (internal/module.js:11:18)

节点版本:14.16

推荐答案

将 pm2 更新到最新版本 此处 立即修复了该问题.

Updating pm2 to the latest version as described here fixed the issue immediatelly.

这篇关于由 pm2 运行时出现意外令牌 * 异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆