node.js - 由 pm2 运行时出现意外的令牌 * 异常
问题描述
尝试通过 pm2 启动节点进程时出现以下异常 - 当我直接执行 app.js 时,一切正常。我看到在堆栈跟踪中提到了 pm2 的 node_modules 文件夹 - 为什么会这样?
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 更新到最新版本 Link
推荐阅读
- javascript - 将静态文本复制到剪贴板?
- installation - 在 appium-chromedriver@4.0.0 安装脚本失败
- c - mingw 下的 fread() 无法正常工作
- php - 具有命名空间问题的 SimpleXml
- java - java.lang.SecurityException:创建 JAR 到 OSGI 包后,Manifest 主要属性的签名文件摘要无效
- sql - 每第n个字符后加逗号,但不能在单词内
- google-bigquery - Power bi 和 bigquery
- vb6 - VB6 在 XMLHttp 请求中包含刻度线
- ruby-on-rails - 使用rails中的复选框检查未定义的方法
- android - 如何在 onDataChange 方法之外获取 arrayList 值,使其不会激活 startActivity