Get PM2 to use new code changes made to a Node.js application?

suparman21 asked this question 8 months ago
suparman21 on Dec 13, 2021

I have Node.js application that is ran using PM2.

When I make code updates to the Node.js application, PM2 doesn't pick up those changes.

How can I tell PM2 to use the new code changes in my application?

2 suggested answers
itsbambi on Dec 15, 2021

You'll need to restart the PM2 application:

pm2 restart app_name

Replace app_name with your application name.

0 replies
nick on Dec 15, 2021 · Edited

You need to restart your application.

Restart a single application:

pm2 restart <your-app-name>

Restart multiple applications:

pm2 restart <app-name> <app-name> <app-name>

Restart all applications:

pm2 restart all
0 replies