如何在 Forever 中使用选项 -r esm
运行脚本?
使用下面的配置,抛出一个错误
说 Unexpected token import
配置:
{
"uid": "app",
"script": "index.js",
"sourceDir": "./",
"args": ["-r", "esm"]
}
命令:永远启动./config.json
。
我已经安装了 esm
,如果我运行 node -r esm ./index.js
,它会完美运行。
最佳答案
试试这个,经过几个小时的搜索,它对我有用。
sudo forever start -c "node -r esm" index.js
关于javascript - 在 Forever 中使用 ESM 运行脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53466624/