Ask coding questions

← Back to all posts
Install pm2 on repl.it
orangegrouptech (3)

Hello!
I'm trying to install pm2 on my repl to automatically restart it when it crashes. However, I get the error that I need to run it as admin. Tried running as sudo but it said sudo not found. Please help! Thanks.

Comments
hotnewtop
Highwayman (1443)

you can't be sudo on replit. you could try to figure out how to download fakeroot and maybe get it to work cause... idk. magic. also if you want to install it and pm2 is just a package from npm, just require it in your nide repl as if it alrready exists on the machine and replit's upm will automagically install it for you.

Highwayman (1443)

@Highwayman oh also there's some sort of install-pkg or pkg-install executable on replit you could use too i think maybe...

https://docs.repl.it/repls/packages

Highwayman (1443)

@orangegrouptech what do I mean about install-pkg or what do I mean about upm?

orangegrouptech (3)

@Highwayman yeah, what do they mean and how do I activate them?

Highwayman (1443)

@orangegrouptech upm is always “on” and install-pkg or pkg-install or whatever it’s called is just an executable in some /bin dir like /usr/bin/ or something so it is also always present and ready to be run.

orangegrouptech (3)

@Highwayman How would I be able to configure/install it?

Highwayman (1443)

@orangegrouptech configure/install fakeroot or pm2?

Highwayman (1443)

Ok so I just learned that you can’t actually use install-pkg anymore, so I guess you’d have to manually search for the correct link from which you can download pm2 and then just curl and compile or however. @orangegrouptech

Highwayman (1443)

Like download it using the browser. @orangegrouptech