Launch parsing panel using pm2

How can I launch the parsing panel on an ongoing basis using pm2? I tried the following:

dashboard.json

{
  "apps" : [{
    "name"        : "parse-dash",
    "script"      : "/usr/local/bin/parse-dashboard",
    "watch"       : true,
    "merge_logs"  : true,
    "cwd"         : "/home/parse",
    "args"         : "--config dashboard-config.json"
  }]
}

and start pm2:

pm2 start dashboard.json

but I get the following error:

evalmachine.<anonymous>:3
    "name"        : "parse-dash",
                    ^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected token ILLEGAL
    at Object.exports.runInThisContext (vm.js:53:16)
    at Object.module.exports.parseConfig (/usr/local/lib/node_modules/pm2/lib/Utility.js:145:17)
    at Object.CLI._startJson (/usr/local/lib/node_modules/pm2/lib/CLI.js:302:23)
    at Object.CLI.start (/usr/local/lib/node_modules/pm2/lib/CLI.js:98:9)
    at /usr/local/lib/node_modules/pm2/bin/pm2:249:13
    at /usr/local/lib/node_modules/pm2/node_modules/async/lib/async.js:181:20
    at replenish (/usr/local/lib/node_modules/pm2/node_modules/async/lib/async.js:319:21)
    at /usr/local/lib/node_modules/pm2/node_modules/async/lib/async.js:330:15
    at Object.async.forEachLimit.async.eachLimit (/usr/local/lib/node_modules/pm2/node_modules/async/lib/async.js:220:35)
    at Command.<anonymous> (/usr/local/lib/node_modules/pm2/bin/pm2:248:13)

I am not familiar with node_modules, and I'm not sure if I point to the right folder.

+4
source share
1 answer

Hi, the person you saved for me, I was just looking for a solution. The problem in your code is the last comma, divided into the following lines:

"name"        : "parse-dash",
"script"      : "/usr/local/bin/parse-dashboard", 

change to:

"name"        : "parse-dash",
"script"      : "/usr/local/bin/parse-dashboard",

hope this helps.

+4
source

All Articles