Skip to content
Sign upLog in
← Back to Community

Install pm2 on repl.it

Profile icon
orangegrouptech

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.

Voters
Profile icon
JolandManzano
Profile icon
ZV1-nostah
Profile icon
fearlessst
Profile icon
hcantongames
Profile icon
LukeC1
Profile icon
Highwayman
Profile icon
orangegrouptech
Comments
hotnewtop
Profile icon
Highwayman

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.

Profile icon
Highwayman

@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

Profile icon
orangegrouptech

@Highwayman
wdym

Profile icon
Highwayman

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

Profile icon
orangegrouptech

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

Profile icon
Highwayman

@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.

Profile icon
orangegrouptech

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

Profile icon
Highwayman

@orangegrouptech
configure/install fakeroot or pm2?

Profile icon
orangegrouptech

@Highwayman
pm2

Profile icon
Highwayman

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

Profile icon
orangegrouptech

@Highwayman
???

Profile icon
Highwayman

Like download it using the browser.

@orangegrouptech

Profile icon
Tanvir-SahuSahu

@Highwayman
you still can use install-pkg

Profile icon
Highwayman

@orangegrouptech

@Tanvir-SahuSahu

Actually, I’d suggest a Nix repl now - it’s way better for packages.