Skip to content

How to make 24/7 hosting bot setup? [Using PM2 Module] #16

Answered by Refloow
d0biar asked this question in Q&A
Discussion options

You must be logged in to vote

There is multiple solutions but using PM2 module would be an optimal solution.

1. Setup the module

  1. Open Command prompt, and open directory of the project files
  2. Use command npm install pm2 --save-prod
    command will add pm2 to module dependencies.

Another solution would be to manually add pm2 to "dependencies" as "pm2": "latest", to package.json
In case of adding pm2 manually to package.json

  • Watch out not to mess up the syntax.
  • Run install.bat to install the module after adding module to package.json.

2. Run the script using the module

  1. Open Command prompt, and open directory of the project files
  2. Use command pm2 start index.js

Another solution would be to manually add command pm2 start …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Refloow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants