When I log at the dashboard for freepbx i get a red “toast” message with some errors related to pm2. I tried reinstalling from cli and I got the following:
fwconsole ma install pm2
Installing/Updating Required Libraries. This may take a while...The following me
ssages are ONLY FOR DEBUGGING. Ignore anything that says 'WARN' or is just a warning
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for
more info.
Installed npm-cache v0.7.0
Running installation..
[npm-cache] [INFO] using /home/asterisk/.package_cache as cache directory
[npm-cache] [INFO] [composer] Dependency config file
/var/www/html/admin/modules/pm2/node/composer.json does not exist. Skipping install
[npm-cache] [INFO] [npm] config file exists
[npm-cache] [INFO] [npm] cli exists
[npm-cache] [INFO] [npm] hash of /var/www/html/admin/modules/pm2/node/package.json:
d533e5835beb0c379c4c571fb8ceaecc
[npm-cache] [INFO] [npm] running [npm install]...
[npm-cache] [INFO] [npm] installed npm dependencies, now archiving
[npm-cache] [INFO] [npm] archiving dependencies from
/var/www/html/admin/modules/pm2/node/node_modules
[npm-cache] [INFO] [bower] Dependency config file /var/www/html/admin/modules/pm2/node/bower.json
does not exist. Skipping install
[npm-cache] [INFO] [npm] installed and archived dependencies
[npm-cache] [INFO] successfully installed all dependencies
Finished updating libraries!
[Symfony\Component\Process\Exception\ProcessFailedException]
The command "runuser 'asterisk' -s '/bin/bash' -c 'cd /var/www/html/admin/modules/pm2/node && mkdir -p
/home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/pm2/node/logs && export
HOME=/home/asterisk && export PM2_HOME=/home/asterisk/.pm2 && export
ASTLOGDIR=/var/log/asterisk
&& export ASTVARLIBDIR=/var/lib/asterisk && export PATH=$HOME/.node/bin:$PATH && export
NODE_PATH=$HOME/.node/lib/node_modules:$NODE_PATH && export
MANPATH=$HOME/.node/share/man:$MANPATH &&
/var/www/html/admin/modules/pm2/node/node_modules/pm2/bin/pm2 ping'" failed.
Exit Code: 1(General error)
Output:
================
Error Output:
================
module.js:338
throw err;
^
Error: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/var/www/html/admin/modules/pm2/node/node_modules/pm2/bin/pm2:4:14)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
ma [-f|--force] [-d|--debug] [--edge] [--color] [--skipchown] [-e|--autoenable] [--skipdisabled] [--snapshot="..."] [--format="..."] [-R|--repo="..."] [-t|--tag="..."] [args1] ... [argsN]
Any tips on how to fix that?
Im running FreePBX distro 10.13.66-22 with asterisk 13.19.1
ICMP packets aren’t really useful in determining connection issues.
Our proxy to the NPM server is currently down (this is for fallback when a client machine has issues connecting or utilizing NPM). So I have no resolution for you at this time.
I’m sorry, I misunderstood what you said. As it seems its from my end.
[root@octopbx-vm ~]# fwconsole ma install pm2
Installing/Updating Required Libraries. This may take a while...The following messages are ONLY FOR DEBUGGING. Ignore anything that says 'WARN' or is just a warning
Found npm-cache v0.7.0
Running installation..
[npm-cache] [INFO] using /home/asterisk/.package_cache as cache directory
[npm-cache] [INFO] creating cache directory
[npm-cache] [INFO] [composer] Dependency config file /var/www/html/admin/modules/pm2/node/composer.json does not exist. Skipping install
[npm-cache] [INFO] [npm] config file exists
[npm-cache] [INFO] [npm] cli exists
[npm-cache] [INFO] [npm] hash of /var/www/html/admin/modules/pm2/node/package.json: d533e5835beb0c379c4c571fb8ceaecc
[npm-cache] [INFO] [npm] running [npm install]...
Session terminated, killing shell...The process "runuser 'asterisk' -s '/bin/bash' -c 'cd /var/www/html/admin/modules/pm2/node && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/pm2/node/logs && export HOME=/home/asterisk && export PM2_HOME=/home/asterisk/.pm2 && export ASTLOGDIR=/var/log/asterisk && export ASTVARLIBDIR=/var/lib/asterisk && export PATH=$HOME/.node/bin:$PATH && export NODE_PATH=$HOME/.node/lib/node_modules:$NODE_PATH && export MANPATH=$HOME/.node/share/man:$MANPATH && npm-cache install --only=production'" exceeded the timeout of 600 seconds.
Finished updating libraries!
[Symfony\Component\Process\Exception\ProcessFailedException]
The command "runuser 'asterisk' -s '/bin/bash' -c 'cd /var/www/html/admin/modules/pm2/node && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/admin/modules/pm
2/node/logs && export HOME=/home/asterisk && export PM2_HOME=/home/asterisk/.pm2 && export ASTLOGDIR=/var/log/asterisk && export ASTVARLIBDIR=/var/lib/asterisk && ex
port PATH=$HOME/.node/bin:$PATH && export NODE_PATH=$HOME/.node/lib/node_modules:$NODE_PATH && export MANPATH=$HOME/.node/share/man:$MANPATH && /var/www/html/admin/m
odules/pm2/node/node_modules/pm2/bin/pm2 ping'" failed.
Exit Code: 1(General error)
Output:
================
Error Output:
================
module.js:338
throw err;
^
Error: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/var/www/html/admin/modules/pm2/node/node_modules/pm2/bin/pm2:4:14)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
ma [-f|--force] [-d|--debug] [--edge] [--color] [--skipchown] [-e|--autoenable] [--skipdisabled] [--snapshot="..."] [--format="..."] [-R|--repo="..."] [-t|--tag="..."] [args1] ... [argsN]
Also this is the output from my PC (same Internet IP - “delete” is the name of the folder)
npm install pm2
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-QFUCsAfzGcP0cXXER0UnMA8qta0= integrity checksum failed when using sha1: wanted sha1-QFUCsAfzGcP0cXXER0UnMA8qta0= but got sha512-zr6QQnzLt3Ja0t0XI8gws2kn7zV2p0l/D3kreNvS6hFZhVU5g+uY/30l42jbgt0XGcNBEmBDGJR71J692V92tA==. (260 bytes)
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'D:\delete\node_modules\.staging\fsevents-8acdc889\node_modules\aws-sign2' -> 'D:\delete\node_modules\.staging\aws-sign2-105bce55'
npm ERR! path D:\delete\node_modules\amp
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'D:\delete\node_modules\amp' -> 'D:\delete\node_modules\.amp.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Moowalker\AppData\Roaming\npm-cache\_logs\2018-03-09T19_43_27_256Z-debug.log
I encountered this same issue on three of my appliances. My Meraki firewall was blocking the URL https://tgz.pm2.io/gkt-1.0.0.tgz with the content filter.
Edit: Actually it was the country filter that I got a little too aggressive with.