我有一个简单的命令,运行时效果很好:
parse-dashboard --config /home/ubuntu/dash/config.json
pm2 start parse-dashboard -- --config=/home/ubuntu/dash/config.json
查看日志,我发现了错误: node: bad option: --config=/home/ubuntu/dash/config.json
node: bad option: --config=/home/ubuntu/dash/config.json
我做错了什么?
使用指定参数的流程文件。创建以下文件并将其命名为示例 ecosystem.json (确保“script”和“cwd”(应用程序将启动的地方)的位置对你来说是正确的)
ecosystem.json
{ "apps" : [{ "name" : "parse-dashboard-wrapper", "script" : "/usr/bin/parse-dashboard", "watch" : true, "cwd" : "/home/parse/parse-dashboard", "args" : "--config /home/ubuntu/dash/config.json" }] }
pm2 start ecosystem.json