Node.js 如何使用参数启动pm2?

Node.js 如何使用参数启动pm2?,node.js,parse-server,pm2,parse-dashboard,Node.js,Parse Server,Pm2,Parse Dashboard,我有一个简单的命令,在运行时可以正常工作: parse-dashboard --config /home/ubuntu/dash/config.json 但是,当与pm2一起运行时,它不起作用: pm2 start parse-dashboard -- --config=/home/ubuntu/dash/config.json 查看日志,我发现错误: node:bad选项:--config=/home/ubuntu/dash/config.json 我做错了什么?使用一个流程文件,在其中指

我有一个简单的命令,在运行时可以正常工作:

parse-dashboard --config /home/ubuntu/dash/config.json
但是,当与pm2一起运行时,它不起作用:

pm2 start parse-dashboard -- --config=/home/ubuntu/dash/config.json
查看日志,我发现错误:
node:bad选项:--config=/home/ubuntu/dash/config.json


我做错了什么?

使用一个流程文件,在其中指定参数。创建以下文件并将其命名为例如
ecosystem.json
(确保“脚本”和“cwd”(应用程序将启动的位置)位置适合您)

并运行它


pm2启动生态系统.json

是否无法通过CLI执行此操作?我真的不想通过json文件执行此操作。请查看这些文档,了解如何通过CLI执行此操作:
{
  "apps" : [{
    "name"        : "parse-dashboard-wrapper",
    "script"      : "/usr/bin/parse-dashboard",
    "watch"       : true,
    "cwd"         : "/home/parse/parse-dashboard",
    "args"        : "--config /home/ubuntu/dash/config.json"
  }]
}