Questions tagged [pm2]

PM2, the ultimate solution for managing Node.js applications, empowers developers with its powerful CLI process manager and a seamless integrated load balancer.

What is the best way to provide execution arguments to an app through PM2?

While attempting to start my app using pm2, I encountered an issue with passing arguments. Despite using the command pm2 start app.js -- dev, I was unable to pass the argument successfully. Interestingly, this worked without any issues when using forever ...

Synchronization problem with Apollo Client cache between multiple instances in a Next.js application using React Apollo and managed with pm2

Currently, I am utilizing Next.js and React Apollo for my application. To ensure optimal performance, I have configured my application to run with pm2 in a clustered mode featuring two instances. However, I have encountered an issue where switching user pr ...

Automatically launch Next.js applications upon restarting an Ubuntu server using pm2

pm2 has been incredibly effective in managing my Next.js application on my Linode cloud server with Ubuntu 20. However, I've encountered some challenges when attempting to automatically run my Next.js apps upon system reboot. Typically, I have been m ...

Using PM2 to Manage Your PHP Scripts in Cluster Mode

Currently, I have been effectively managing single instances of PHP daemons with PM2, and so far everything is running smoothly! When it comes to managing Node.js/IO.js apps with PM2, I can easily launch them in cluster mode without any issues. However, t ...

When a process crashes, PM2 automatically launches a new daemon but fails to restart the processes

My application "prod" does not restore on SIGINT, resulting in PM2 crashing all other applications and restarting the daemon. If I manually kill other applications, they function properly by automatically restarting. The logs show: (process:3626): GLib- ...

Struggling with Docker build hanging on pm2 start command

I am trying to build a docker container by using the following Dockerfile: FROM node:12-buster WORKDIR /opt/myapps/ COPY . /opt/myapps/ RUN apt update RUN apt upgrade -y RUN apt install git -y RUN git config --global user.email "someone@example.com" RUN ...

The <core.pid> file in Node.js is specifically generated on a single node

Running a high-availability architecture with two identical EC2 instances under a load balancer, I have a production workspace where the application is vue.js using 'nuxt' and daemonized with pm2. However, disk space on only one node keeps filling up due t ...

Leveraging PM2 for executing additional npm scripts

Within my package.json file, I've configured two scripts: start for local development and production for deployment. When using npm, I can simply run npm run production. However, how can I achieve the same result with pm2? ...

Addressing the issue of pm2 with netmask 1.0.6 posing a serious security risk

While working on my project, I encountered a problem in the terminal when using the pm2-runtime command for the runtime environment. When running the command npm i, I received warnings at two levels: High netmask npm package vulnerable to octa ...

Running node.js on a hostinger VPS deployment is causing a halt

After successfully uploading my node app into hostinger and running npm start without any issues, I'm still unable to access http://my-ip:3000. https://i.stack.imgur.com/EyUbS.png All the necessary dependencies such as node, npm, and MySQL have already ...

Unraveling the process: Navigating into the Node.js application log launched with pm2

During the development of my Node.js application, I utilized Socket.IO, Express, MySql, and https. Initially, everything was functioning perfectly until I decided to "deamonize" it using pm2. Surprisingly, after this implementation, my socket connection ap ...

pm2 is launching multiple instances of identical next.js applications

I am in the process of deploying my Next.js app on my local PC. Below are the contents of my configuration and package.json files: // package.json { "name": "smarf", "private": true, "scripts": { "dev ...

After running a npm run build command and hosting it on nodejs express.static, I attempted to start the app using pm2. However, I encountered an issue when trying to

I needed to set up hosting for 2 different node apps on a single Linux box from AWS EC2. I wanted to create a development environment and a staging environment, each using its own port. However, the issue I am currently facing is not related to port confli ...

Is it possible to utilize pm2 in place of a load balancer?

Currently, my application is operating on Elastic BeanStalk in AWS. I am considering using pm2 to manage my application and disabling the load balancer. Is it more beneficial to have just one load balancer or to have two simultaneously? ...

Troubleshooting PM2 Error When Starting Node.js Application

Currently, I am attempting to launch a nodejs application that I created on my Windows computer onto my Ubuntu Server 14.04. After installing both nodejs and pm2, I encountered an issue when trying to initialize the pm2 web interface with pm2 web or start ...

Setting up a Node application on a server with the help of Apache, npm, and pm

            I recently deployed a Node.js application (myapp.js) on a server with a specific IP address. The installation and startup process using npm went smoothly this time around, unlike past experiences with Apache which were much more complic ...

Having issues with Node timing out while running with pm2 on an ubuntu server

I've recently delved into learning node/express and successfully created an api on my local machine that connects to a mongo atlas database. Everything was running smoothly until I decided to deploy it on a Digital Ocean VPC using Ubuntu 23.10 with no ...

Setting the port for Next.js on PM2 involves configuring the ecosystem file in the project

I am currently working on a standard next js application and have the following scripts in my package.json file. "scripts": { "dev": "next dev", "build": "next build", "start": " ...

Deploying NodeJS applications using PM2, with support for both clustered and single instances

Consider the following scenario: The server has a scoped pm2 instance running in the /project directory A new version of the app is pushed to master branch The continuous integration (CI) system builds the new version How can I instruct CI to deploy the ...

Unable to find npm and pm2 commands during the execution of GitHub actions on EC2 instance

I'm currently utilizing a GitHub Actions workflow. Here's the code snippet: name: Deploy to EC2 on: workflow_dispatch: # Manual trigger jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/ ...

What is the best way to use PM2 for deploying my node.js application to various environments and ports within a single server?

I am facing an issue with deploying my node app using the ecosystem.json file and PM2. Despite trying various configurations, I have been unable to achieve my desired goal: To deploy the app in either a production or staging environment (both currently ...

Having trouble with pm2 starting up correctly?

I have encountered an issue while trying to launch a nodejs application in pm2 on bluehost shared hosting. When I run the command pm2 start ./bin/www, the server fails to start and displays the following message: [PM2] Spawning PM2 daemon with pm2_home=/h ...

Express app not appearing in browser when using PM2

Utilizing PM2 within my Express application for process management and load balancing. Following the installation of PM2, I ran the command pm2 start bin/www which executed successfully in the command prompt, displaying the expected result: However, upon ...

Tips for resolving Error: EACCES - permission denied when using pm2

I'm stumped by this error that keeps popping up when I run pm2 status: kaitoSwift@kaito-MacBook-Pro school-sms2 % pm2 status node:internal/fs/utils:344 throw err; ^ Error: EACCES: permission denied, open '/Users/kaitoSwift/.pm2/pm2.log' at Obj ...

The npm ping feature is causing command prompt windows to open

I am currently working on a project that involves pinging certain IPs. I have opted to use the npm ping package for this purpose, which can be found at https://www.npmjs.com/package/ping. Initially, when I run the service, everything works perfectly fine. ...

The elusive 404 error strikes again as the Nginx server frantically searches for the default path 'etc/nginx/html/index.html' within the NextJS application

I've been struggling with a persistent 404 issue for days now and could really use some assistance. My system is CentOS7 (CPanel, VPS) with engintron for the nginx reverse proxy and pm2 to run my next.js application. default.conf server { listen ...

Guide on launching a NodeJS Express API using PM2 on a cPanel shared hosting server

I have set up an API using Express configured to run on PM2 instead of the node process. Currently, I am using ventraIP shared hosting with cPanel. The cPanel provides options to set up a NodeJS app, configure directories, perform npm installs, and use us ...

What steps should I take to address the problems encountered when trying to launch an application in PM2 on a

My current project involves setting up Docusaurus on Windows Server 2016 with Node.js version 12.14.0 using PM2 on IIS10 for automatic app restarts after server reboots. Although new to Node.js, I followed the typical process of running npm run start withi ...

The server experiences a continuous rise in active handles, leading to a slowdown in server performance

I created a basic node API that simply notifies the user about internet connectivity. Everything runs smoothly when hitting this API every 3 seconds as long as the active handles are under 4000. However, once it goes beyond that limit, my server becomes un ...

Ensure your server stays alive and active with ReactPHP, just like the "pm2" process manager for "NodeJS"

I was recently taking a deep dive into learning about the fascinating world of "ReactPHP", but I ran into a bit of confusion regarding how to keep it running on the server in case of errors. After some research, I discovered that "NodeJS" has a handy tool ...

Encountering problems while trying to run a discord.js v14.3.0 bot on a virtual private server

I just set up a VPS to host my discord.js bot, but I keep encountering errors when checking the logs from PM2 [pm2 log], causing the bot to go offline and encounter errors. I'm puzzled because the template was originally used in a repl.it project where ev ...

Starting PM2 with multiple instances can be achieved by following these steps

While running my nodejs code with PM2, I encountered a requirement for multiple instances of nodejs executing the same code. To address this need, I created a script named "myscript.sh": cd ~/myproject PM2_HOME='.pm2_1' /usr/local/bin/node /usr/local/l ...

Mastering the use of node cluster mode in conjunction with agenda cronjobs

Currently, I am utilizing nodejs and agenda to run cronjobs. With a total of 10 cronjobs in place, the process is taking longer as nodejs is single-threaded and they all run simultaneously. In an attempt to resolve this issue, I experimented with pm2 by e ...

Having trouble launching a node application from a different folder location

I am encountering an issue with my MVC application using Node.js/Express. When I start the app using PM2 within a specific directory, everything works fine. However, if I try to start it from another directory, the app seems to start but then complains th ...

Leverage the power of pm2 when running a Next.js application within a

I am encountering a 404 error when trying to use pm2 on a docker image. I have included the following command in my dockerfile. Can someone confirm if this is the correct way to call it? CMD ["node_modules/.bin/pm2-runtime", "node_modules/. ...

Combining/naming PM2 applications

Looking at the PM2 configuration located at /home/foo/someconfig.json { "apps": [ { "name": "foo-main", "script": "./index.js", }, { "name": "foo-bar", "script": "./bar.js" ...

While running a Conda command through a Node.js script with the use of PM2, I encountered an error stating "/bin/sh: 1: conda: not

Overview In the production environment, I am utilizing pm2 to run a nodejs server. The server executes a javascript file that triggers a python script using the conda run method. Unfortunately, an error occurs with the message: /bin/sh: 1: conda: not foun ...

View the list of cron jobs in PM2

Greetings, I have initiated two cron jobs using pm2 and am curious if there is a method to display a list of these cron jobs. Both of the cron jobs are responsible for running a shell script to control the server's start/stop functionality. Addition ...

Error 502 is being returned by the Nginx server for specific directories within the Express Application

Currently, I have an express application running on Ubuntu with nginx as the web server. Everything was functioning correctly until today when I attempted to add two new directories using the app.get method and re-deployed my app. Unfortunately, the new ...

utilizing PM2 on a Windows server with a traditional Azure pipeline configuration

I am currently working on setting up a release pipeline using classic Azure pipelines for my Next.js project deployment on a self-hosted Windows server. I have configured IIS as a redirection server to redirect traffic to the Next.js application. However, ...

Looking for assistance with properly updating pm2 in my Next.js project

When I update my NextJS app on ubuntu using Nginx and pm2, I typically add new text to my codebase. Here's the process I follow: git add . git commit -m 'new commit' git push After making changes, I navigate to my file directory in the cons ...

"Encountered a problem during the installation of pm2 for Node.js

I am in the process of installing pm2 (https://github.com/Unitech/pm2) Encountered the following error while doing so: D:\_Work>npm install pm2 -g --unsafe-perm npm WARN `git config --get remote.origin.url` returned wrong result (http://ikt.pm2.io/ ...

Launching a new VueJS app using PM2 generates a blank process rather than the expected result

pm2 start npm -- serve pm2 start npm --watch -- run dev pm2 start npm --name "vue-app" -- start sudo pm2 start npm run serve --name vue-app -- start When I execute these commands, a process starts but my app does not launch. When I run sudo lsof ...

Exploring Key Factors for an Optimal Launch of a Node.js Application Using pm2 Cluster Mode

I'm highly interested in incorporating cluster mode for load balancing my node.js application. However, I've been unable to locate any reliable documentation regarding potential adjustments needed for running in cluster mode. Do you have any insights on ...

Raspberry Pi experiences issues with PM2

I attempted to set up pm2 on a Raspberry Pi. I used the command sudo npm install -g pm2: pi@raspberrypi:~ $ sudo npm install -g pm2 /usr/bin/pm2 -> /usr/lib/node_modules/pm2/bin/pm2 /usr/bin/pm2-dev -> /usr/lib/node_modules/pm2/bin/pm2-dev /usr/bin/ ...

Troubles encountered during PM2 installation on macOS: "warning [email protected]" or "error code EACCES"

For some reason, I cannot seem to get PM2 to work properly on my macOS system. Despite multiple attempts and trying different methods like using sudo and adjusting npm directory permissions, the 'pm2' command remains unrecognized. Hello there, I'm curren ...

Encountering an issue when starting a Node.js/Swagger application using pm2 within a Docker environment: Unable to

1. Overview: I successfully developed a basic application using Node.js, Express, and Swagger by following this informative tutorial, along with the help of generator-express-no-stress. However, when I attempt to run the application within a Docker contai ...