Questions tagged [pm2]

PM2 is a CLI process manager for Node.js applications with a built-in load balancer

pm2 is a process manager for Node apps with a built-in load-balancer.

pm2 is perfect when you need to spread your stateless NodeJS code across all CPUs available on a server, to keep all processes alive forever and to 0s reload them. pm2 reloads scripts when they crash, can manage multiple processes at once, and all without downtime.

It is an NPM CLI application that runs in io.js and node.js on Windows, Mac OSX, and Linux.

Main features

  • Builtin load-balancer (using the native cluster module)
  • Script daemonization
  • 0s downtime reload for Node
  • Startup scripts for Ubuntu and CentOS
  • Stop unstable process (avoid infinite loop)
  • Monitoring in console
  • HTTP API
  • Remote control and real time interface API

Questions can be tagged with "pm2" for problems with running applications using pm2.

For more information:

2258 questions
0
votes
2 answers

azure app service angular app 404 error when routes accessed directly

The linux app service is configured with a Node 18 LTS stack and a startup command that's set to: pm2 serve /home/site/wwwroot --no-daemon --spa The --spa tag is supposed to make all routes fallback to index.html which is not the case when…
Mehdi Benmoha
  • 3,694
  • 3
  • 23
  • 43
0
votes
1 answer

SyntaxError: Unexpected identifier 'pipefail'

I am having this issue when I try to deploy NodeJS app (built with NextJS) using pm2. I follow the instruction described here. My attempt to execute pm2 start command seemed working, as shown by the snippet…
0
votes
1 answer

Why does my "pm2 logs" process continue running after my ssh connection closes?

I have a bash script I use for accessing the pm2 logs on my server: ssh user@hostname source ./activate-node-env.sh && pm2 logs my-app It works great -- the log stream opens up (as though I'm running tail -f), and I ctrl-C when I'm done. But…
bennlich
  • 1,207
  • 10
  • 21
0
votes
0 answers

BigQuery Error while running query on prod

So this is the error I am getting ApiError: Syntax error: Missing whitespace between literal and alias at [2:18] 1|index | at new ApiError…
Sahil
  • 23
  • 1
  • 5
0
votes
0 answers

PM2 cluster mode run multiple redis pub/sub clients

I try to use PM2 cluster mode to run multiple redis pub/sub clients. However, the clients can not connect successfully. If I just use PM2 fork mode, the redis pub/sub clients works well. I tried to find the solution, but I can'f find any useful…
lindon
  • 1
0
votes
0 answers

Using pm2 for .jar Java API management?

Im using pm2 to manage some .jar API services on my linux server, and it works fine, but I wonder if this is "state-of-the-art", due to pm2 is supposed for javascript?
0
votes
1 answer

Avoiding rate limits for APIs as website starts to scale

I am relying on the steam API in order for my website to work. In the start everything was working perfectly fine, however now that the site is gaining popularity I keep getting 429 error codes as the API reaches ratelimit. I am hosting the site on…
Ole Dybedokken
  • 343
  • 2
  • 15
0
votes
1 answer

How to install PM2 on Node js 8?

I have tried to install PM2 on my node js project that running on node JS 8. How to install PM2 on Node js 8 ? Error message: npm install npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ikt@git+http://ikt.pm2.io/ikt.git#master…
YUID DAAI
  • 47
  • 5
0
votes
0 answers

Paypal-js integration not working with PM2

Using paypal-js integration with PM2 in On, gives errors and closes paypal purchase window. when I use npm start instead of PM2 the integration works fine, and I can access the purchase window, dont know where the problem is!
0
votes
0 answers

Restarting PM2 when the latency of the API it's serving becomes high

I have an EC2 instance running which is housing a nodeJS/GraphQL based API application. The application is managed via PM2. I want to have a setup/configuration which can continuously ping one endpoint (actual API) on the server to keep monitoring…
beNerd
  • 3,314
  • 6
  • 54
  • 92
0
votes
0 answers

Vue.js & Nuxt cache

We are hosting a nuxt application with nginx as a reverse proxy and pm2. The application was hosted on domain.com and after a few months transferred to subdomain.domain.com. The domain.com was pointed to completely different server (with apache) and…
0
votes
0 answers

why error occured when deploy nodejs app using pm2

I am experiencing an odd error while deploying my nodejs app using pm2. node version: 16.14.2 npm version: 8.5.0 this is the error that returning: --> Deploying to development environment --> on host ****** ○ hook pre-setup ○ running setup ○…
0
votes
0 answers

How to --require a js file in pm2 setup?

I am would like to preload the specified module at startup. For which I had added node parameter --require somefile.js with my app.js startup command. This setup works perfectly fine. However, when I try the same with pm2 by adding in the node_args.…
Bikas Katwal
  • 1,895
  • 1
  • 21
  • 42
0
votes
0 answers

improving the performance of my app on ec2

it is my first time uploading something to a server. I'm using ec2 from aws, the free trial. When i run node index.js the program work pretty good and fast. But when i close the ec2 terminal, the system just crash and stop work. i find out a…
Luis Paulo
  • 54
  • 4
0
votes
0 answers

PM2 not able to run docker-compose up

I'm trying to start a service using docker-compose up, but pm2 is not able to execute docker-compose file. docker-compose up command runs fine if I execute it manually, it just fails when pm2 executes it I've already tried changing PM2 and node…