hagopj13 / node-express-boilerplate

A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose
MIT License
6.98k stars 2.05k forks source link

pm2: not found #132

Open ahmetkuslular opened 3 years ago

ahmetkuslular commented 3 years ago

Hello. I deployed the project to the aws ec2. It gives this error when running. I tried a few things but no results. how do i solve this?

node-app-prod | $ pm2 start ecosystem.config.json --no-daemon
node-app-prod | /bin/sh: pm2: not found
node-app-prod | error Command failed with exit code 127.
Markkos89 commented 3 years ago

you should install pm2 on ec2 instance.

eitherway I recommend using Elastic Beanstalk with a github action to deploy it, wich also @hagopj13 would you like to me to build one and include it in the main template? or not required? regards

ahmetkuslular commented 3 years ago

I'm serving with docker so I don't need to install an instance? I install it globally in docker, but it does not give any results.

RUN npm install pm2 -g

ruxxzebre commented 3 years ago

pm2 start command inside docker container should be replaced with pm2-runtime which is designed for such cases.

trung1704ptit commented 1 year ago

@ahmetkuslular I got the same issue with PM2 when I build with docker, how do you fix this issue?