Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.31k stars 2.61k forks source link

error: unknown option `--start' #4874

Open kennedydmb opened 3 years ago

kennedydmb commented 3 years ago

What's going wrong?

I am trying to run a React app using the command pm2 start npm --name "Test App" --start

It is something that has worked many times before, however it now reports: error: unknown option--start'`.

If I try without --start, the CPU usage fluctuates between 0% and 150%.

It also doesn't seem to run in the port that I have defined in package.json: "scripts": { "start": "PORT=3025 react-scripts start",, again this is something that normally works for me.

How could we reproduce this issue?

I am unsure how this problem could be reproduced as I cannot find anyone else with a similar issue, I myself didn't have this issue up until a few days ago.

Supporting information

The only thing that I can think of that correlates is that I recently force cleared npm cache recently. Pm2 version is 4.4.1

PM2        | 2020-10-09T10:12:48: PM2 log: App [Test App:24] starting in -fork mode-
PM2        | 2020-10-09T10:12:48: PM2 log: App [Test App:24] online
PM2        | 2020-10-09T10:12:49: PM2 log: App [Test App:24] exited with code [1] via signal [SIGINT]
PM2        | 2020-10-09T10:12:49: PM2 log: App [Test App:24] starting in -fork mode-
PM2        | 2020-10-09T10:12:49: PM2 log: App [Test App:24] online
PM2        | 2020-10-09T10:12:49: PM2 log: App [Test App:24] exited with code [1] via signal [SIGINT]
PM2        | 2020-10-09T10:12:49: PM2 log: App [Test App:24] starting in -fork mode-
PM2        | 2020-10-09T10:12:49: PM2 log: App [Test App:24] online
PM2        | 2020-10-09T10:12:50: PM2 log: App [Test App:24] exited with code [1] via signal [SIGINT]
PM2        | 2020-10-09T10:12:50: PM2 log: App [Test App:24] starting in -fork mode-
PM2        | 2020-10-09T10:12:50: PM2 log: App [Test App:24] online
PM2        | 2020-10-09T10:12:51: PM2 log: App [Test App:24] exited with code [1] via signal [SIGINT]
PM2        | 2020-10-09T10:12:51: PM2 log: App [Test App:24] starting in -fork mode-
PM2        | 2020-10-09T10:12:51: PM2 log: App [Test App:24] online
PM2        | 2020-10-09T10:12:51: PM2 log: App [Test App:24] exited with code [1] via signal [SIGINT]
PM2        | 2020-10-09T10:12:51: PM2 log: App [Test App:24] starting in -fork mode-
PM2        | 2020-10-09T10:12:51: PM2 log: App [Test App:24] online
PM2        | 2020-10-09T10:12:52: PM2 log: App [Test App:24] exited with code [1] via signal [SIGINT]
PM2        | 2020-10-09T10:12:52: PM2 log: App [Test App:24] starting in -fork mode-
PM2        | 2020-10-09T10:12:52: PM2 log: App [Test App:24] online
letzfets commented 3 years ago

metoo

letzfets commented 3 years ago

I figured it out on my side. It's pm2 start npm -- start not pm2 start npm --start @kennedydmb: Note the space before start

letzfets commented 3 years ago

I suggest "closed in comments"

DhruvinS720 commented 1 year ago

I figured it out on my side. It's pm2 start npm -- start not pm2 start npm --start @kennedydmb: Note the space before start

thanks bro

fefegit commented 1 year ago

I figured it out on my side. It's pm2 start npm -- start not pm2 start npm --start @kennedydmb: Note the space before start

Tks man. 2 days looking for this simple answer.

SuppliedOrange commented 1 month ago

Doesn't seem to work for me.

  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "npx tsx index.ts"
  },
PS C:\...\Desktop\py\AudioProcessorWhisper\twitch_bot> pm2 start npm -- start
[PM2] Starting C:\PROGRAM FILES\NODEJS\NPM.CMD in fork_mode (1 instance)
[PM2] Done.
[PM2][ERROR] Script not found: C:\...\Desktop\py\AudioProcessorWhisper\twitch_bot\start