Error to install PM2 globally on Ubuntu Server 20.04LTS

March 4, 2022 . 1 MIN READ

Step 3 — Installing PM2

Next let’s install PM2, a process manager for Node.js applications. PM2 makes it possible to daemonize applications so that they will run in the background as a service.

Use npm to install the latest version of PM2 on your server:

·         sudo npm install pm2@latest -g·

 

Copy

The -g option tells npm to install the module globally, so that it’s available system-wide.

Let’s first use the pm2 start command to run your application, hello.js, in the background:

·         pm2 start hello.js

Reference:

https://stackoverflow.com/questions/62201790/error-to-install-pm2-globally-on-ubuntu-server-20-04lts

 

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04

Leave a Reply

Your email address will not be published. Required fields are marked *