pm2 module offline installation
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?
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
Possible starting PM2 2.X
$ pm2 install my-packed-module.tgz
I tried that with no luck. How exactly the packed module should be packed? Still no mention in documentation.
You can use something like npm-bundle pm2-logrotate
Even with this offline installation it still requires git. Any idea?
You have to use the absolute path to the module like this:
pm2 install /home/user/pm2-logrotate-2.7.0.tgz
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.