Install PM2 Offline

Latest response

hello, I'm installing pm2 on redhat 7 offline, and I found an error like below, is there someone who can give me a solution to this error. thanks

[root@redhat pm2-installer-master]# npm run setup

pm2-installer@2.0.5 setup /root/pm2-installer-master/pm2-installer-master
node ./src/script-for-os.js

pm2-installer@2.0.5 setup:unix /root/pm2-installer-master/pm2-installer-master
bash ./src/unix/setup.sh

=== Setup ===
Running on: 3/25/2020, pm2-installer 2.0.5 with node v12.16.1 and npm 6.13.4 on linux-3.10.0-1062.18.1.el7.x86_64.
* Installing pm2
Bundled on: 3/25/2020, pm2-installer 2.0.5 with node v12.16.1 and npm 6.13.4 on linux-3.10.0-1062.18.1.el7.x86_64.
√ Offline install bundle appears valid.
Cache detected, installing offline..
Cache verified and compressed (~/pm2-installer-master/pm2-installer-master/.npm_cache/_cacache):
Content verified: 0 (0 bytes)
Index entries: 0
Finished in 0.012s
npm ERR! code ENOTCACHED
npm ERR! request to http://registry.npmjs.org/pm2 failed: cache mode is 'only-if-cached' but no cached response available.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/pm2-installer-master/pm2-installer-master/.npm_cache/_logs/2020-03-25T05_47_04_472Z-debug.log
npm ERR! code ENOTCACHED
npm ERR! request to http://registry.npmjs.org/pm2-logrotate failed: cache mode is 'only-if-cached' but no cached response available.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/pm2-installer-master/pm2-installer-master/.npm_cache/_logs/2020-03-25T05_47_04_815Z-debug.log
./src/unix/setup.sh: line 32: pm2: command not found
./src/unix/setup.sh: line 35: cd: /usr/lib/node_modules/pm2-logrotate/: No such file or directory
./src/unix/setup.sh: line 36: pm2: command not found
./src/unix/setup.sh: line 37: pm2: command not found
=== Setup Complete ===

Responses

Hello! I'm the maintainer of the pm2 installer project. Prior to version 2.0.8, there was an issue where the cache could be erroneously cleared prior to setup, and it looks like that's what happened here. Try a newer version and it should behave as expected. I hope this is helpful!

Hi Jesse, I've installed rh-nodejs10 from our RHSCL comany repository. However, when I try to install PM2, I get the following errors:

WARN checkPermissions Missing write access to /opt/rh/rh-nodejs10/root/usr/bin npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN enoent ENOENT: no such file or directory, open '/opt/rh/rh-nodejs10/root/usr/bin/package.json' npm WARN ws@7.2.5 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself. npm WARN ws@7.2.5 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself. npm WARN bin No description npm WARN bin No repository field. npm WARN bin No README data npm WARN bin No license field.

npm ERR! path /opt/rh/rh-nodejs10/root/usr/bin npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/opt/rh/rh-nodejs10/root/usr/bin' npm ERR! { [Error: EACCES: permission denied, access '/opt/rh/rh-nodejs10/root/usr/bin'] npm ERR! stack: npm ERR! 'Error: EACCES: permission denied, access \'/opt/rh/rh-nodejs10/root/usr/bin\'', npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/opt/rh/rh-nodejs10/root/usr/bin' }

Is that the correct directory for nodejs to be installed, am I missing some links that need to be manually created and why does PM2 not install when NPM is installed with nodejs?