An alternate way to install pm2 offline is:
Create the tar file with the above steps mentioned by @soren.
in my case Installation hung while executing "npm install pm2.tar.gz".
npm install pm2.tar.gz
[..................] - fetchMetadata: sill resolveWithNewModule [email protected] checking installable status
[..................] - fetchMetadata: sill resolveWithNewModule [email protected] checking installable status
to get this resolved I have added the npm registry but that did not work.
npm config set registry="http://registry.npmjs.org"
Server's are into the DMZ or in a private subnet that's it's was not working.
Solution:-
Get the install path of the node_module directory
#npm config get prefix
Extract the tar file & Copy the pm2 directory to node_module
#tar -zxvf pm2.tar.gz
#cp pm2 /usr/local/lib/node_modules/npm/node_modules/ -r
cd into the /usr/bin & Crete the simlink for pm2
# cd /usr/bin
#ln -s /usr/local/lib/node_modules/npm/node_modules/pm2/bin/pm2 pm2
check pm2 command output & its output.
# pm2
usage: pm2 [options] <command>
pm2 -h, --help all available commands and options
pm2 examples display pm2 usage examples
pm2 <command> -h help on a specific command
Access pm2 files in ~/.pm2