Pm2: Can't "pm2 startup" on OSX Yosemite

Created on 4 Oct 2015  路  6Comments  路  Source: Unitech/pm2

$ pm2 startup
[PM2] You have to run this command as root. Execute the following command:
      sudo su -c "env PATH=$PATH:/usr/local/bin pm2 startup darwin -u tanel"

$ sudo su -c "env PATH=$PATH:/usr/local/bin pm2 startup darwin -u tanel"
Password: *****
su: illegal option -- c
usage: su [-] [-flm] [login [args]]

Seems like the SU command on OSX no longer supports the -c switch.

Most helpful comment

Just sudo pm2 startup.

All 6 comments

Just sudo pm2 startup.

If MacOS == darwin then it's got a bug:

$ pm2 startup darwin
[PM2] You have to run this command as root. Execute the following command:
      sudo su -c "env PATH=$PATH:/Users/collumj/.nvm/versions/node/v4.2.0/bin pm2 startup darwin -u collumj --hp /Users/collumj"

collumj@por-collumj-m ~/work/projects-akmak/serd-inspection-processor (master) 15:36:11  
$ sudo su -c "env PATH=$PATH:/Users/collumj/.nvm/versions/node/v4.2.0/bin pm2 startup darwin -u collumj --hp /Users/collumj"
su: illegal option -- c
usage: su [-] [-flm] [login [args]]

I have the same problem as jcollum

Running it with sudo (sudo pm2 startup darwin) worked. The generated command from pm2 startup darwin still appears to have a bug though.

This could use a fix. The output from pm2 startup darwin without sudo is too confusing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rangercyh picture rangercyh  路  4Comments

cchan picture cchan  路  3Comments

alexpts picture alexpts  路  3Comments

ghost picture ghost  路  3Comments

ldarren picture ldarren  路  3Comments