pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

pm2 module offline installation

Open panuhorsmalahti opened this issue 11 years ago • 7 comments

Hi, I'd like to install a pm2 module (in this case pm2-logrotate) without a network connection. Is this possible? I can probably install the pm2 module to .pm2/node_modules using npmbox, but how can I get pm2 to active the module?

panuhorsmalahti avatar Jul 28 '15 11:07 panuhorsmalahti

Hello, Good question, this needs to be documented in the future,

PM2 auto start all modules present in .pm2/node_modules, a good practice would be to directly tar the .pm2 folder and untar it in your offline server.

Note: pm2 export = generate .tar.gz with modules, configuration, dump file etc

Unitech avatar Jul 28 '15 12:07 Unitech

Possible starting PM2 2.X

$ pm2 install my-packed-module.tgz

Unitech avatar Dec 17 '17 23:12 Unitech

I tried that with no luck. How exactly the packed module should be packed? Still no mention in documentation.

maczor avatar Feb 10 '18 00:02 maczor

You can use something like npm-bundle pm2-logrotate

FrankGoortani avatar Aug 13 '18 16:08 FrankGoortani

Even with this offline installation it still requires git. Any idea?

seancheung avatar Sep 06 '19 02:09 seancheung

You have to use the absolute path to the module like this:

pm2 install /home/user/pm2-logrotate-2.7.0.tgz

javierportillo avatar Dec 01 '20 23:12 javierportillo

I realize I have to do the following steps: On machine that setup correctly: (have internet), go to .pm2 folder, copy following files:

.pm2/modules/pm2-logrotate
.pm2/module_conf.json

BOTH FILES needs to be copied over to the destination machine, then only the destination.. restart pm2 by pm2 kill , then pm2 list then only able to see the logrotate module is loaded.

divineforge avatar Mar 16 '21 12:03 divineforge