Problem reinstalling pm2

Hello,

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

Thank you.

Hi
Please try first to uninstall then install again.
fwconsole ma uninstall pm2
fwconsole r --verbose
fwconsole ma downloadinstall pm2

I can’t uninstall it cause I get the following:

fwconsole ma uninstall pm2
The following error(s) occured:
Cannot disable: The following modules depend on this one: ucpnode,vqplus,xmpp,zulu

Shall I remove all those too?

fwconsole ma remove pm2 --force
fwconsole ma downloadinstall pm2

2 Likes

Thanks @tm1000 :slight_smile:

[[email protected] ~]# fwconsole ma remove pm2 --force
Module pm2 successfully deleted
Updating Hooks...Done
[[email protected] ~]# fwconsole ma downloadinstall pm2
No repos specified, using: [standard,extended,commercial] from last GUI settings

Starting pm2 download..
Processing pm2
Verifying local module download...Verified
Extracting...Done
Module pm2 successfully downloaded
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] [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] cache exists
[npm-cache] [INFO] [npm] clearing installed dependencies at /var/www/html/admin/modules/pm2/node/node_modules
[npm-cache] [INFO] [npm] ...cleared
[npm-cache] [INFO] [npm] retrieving dependencies from /home/asterisk/.package_cache/npm/2.15.11/d533e5835beb0c379c4c571fb8ceaecc.tar.gz
[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] done extracting
[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/bi
  n:$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]

Still the same problem. Also my modules list:

No repos specified, using: [standard,extended,commercial] from last GUI settings

+---------------------+-------------+-----------------------------------+------------+
| Module              | Version     | Status                            | License    |
+---------------------+-------------+-----------------------------------+------------+
| accountcodepreserve | 13.0.2.2    | Enabled                           | GPLv2      |
| announcement        | 13.0.7.1    | Enabled                           | GPLv3+     |
| areminder           | 13.0.10.6   | Enabled                           | Commercial |
| arimanager          | 13.0.4      | Enabled                           | GPLv3+     |
| asterisk-cli        | 13.0.4      | Enabled                           | GPLv3+     |
| asteriskinfo        | 13.0.7.1    | Enabled                           | GPLv3+     |
| backup              | 13.0.27.17  | Enabled                           | GPLv3+     |
| blacklist           | 13.0.14.9   | Enabled                           | GPLv3+     |
| broadcast           | 13.0.12.10  | Enabled                           | Commercial |
| builtin             |             | Enabled                           |            |
| bulkhandler         | 13.0.14.4   | Enabled                           | GPLv3+     |
| callback            | 13.0.5.2    | Enabled                           | GPLv3+     |
| callerid            | 13.0.8.9    | Enabled                           | Commercial |
| callforward         | 13.0.4.2    | Enabled                           | AGPLv3+    |
| calllimit           | 13.0.5.5    | Enabled                           | Commercial |
| callrecording       | 13.0.11.5   | Enabled                           | AGPLv3+    |
| callwaiting         | 13.0.4.1    | Enabled                           | GPLv3+     |
| campon              | 13.0.4.1    | Enabled                           | GPLv3+     |
| cdr                 | 13.0.32     | Enabled                           | GPLv3+     |
| cel                 | 13.0.26.2   | Enabled                           | GPLv3+     |
| certman             | 13.0.37     | Enabled                           | AGPLv3+    |
| cidlookup           | 13.0.12.2   | Enabled                           | GPLv3+     |
| conferences         | 13.0.23.9   | Enabled                           | GPLv3+     |
| conferencespro      | 13.0.27.7   | Enabled                           | Commercial |
| configedit          | 13.0.7.1    | Enabled                           | AGPLv3+    |
| contactmanager      | 13.0.42.12  | Enabled                           | GPLv3+     |
| core                | 13.0.122.10 | Enabled                           | GPLv3+     |
| cos                 | 13.0.11.11  | Enabled                           | Commercial |
| customappsreg       | 13.0.5.4    | Enabled                           | GPLv3+     |
| cxpanel             | 13.0.5.1    | Enabled                           | GPLv3      |
| dahdiconfig         | 13.0.33.13  | Enabled                           | GPLv3+     |
| dashboard           | 13.0.25.3   | Enabled                           | AGPLv3+    |
| daynight            | 13.0.15     | Enabled                           | GPLv3+     |
| dictate             | 13.0.5      | Enabled                           | GPLv3+     |
| digium_phones       | 13.0.7.4    | Enabled                           | GPLv2      |
| directory           | 13.0.19.5   | Enabled                           | GPLv3+     |
| disa                | 13.0.6.1    | Enabled                           | AGPLv3+    |
| donotdisturb        | 13.0.3.1    | Enabled                           | GPLv3+     |
| dundicheck          | 2.11.0.3    | Enabled                           | GPLv3+     |
| endpointman         | 13.0.7.18   | Enabled                           | GPLv2+     |
| extensionroutes     | 13.0.8      | Enabled                           | Commercial |
| extensionsettings   | 13.0.4      | Enabled                           | GPLv3+     |
| fax                 | 13.0.40.4   | Enabled                           | GPLv3+     |
| faxpro              | 13.0.38.7   | Enabled                           | Commercial |
| featurecodeadmin    | 13.0.6.4    | Enabled                           | GPLv3+     |
| findmefollow        | 13.0.38.11  | Enabled                           | GPLv3+     |
| firewall            | 13.0.49.2   | Enabled                           | AGPLv3+    |
| framework           | 13.0.194.5  | Enabled                           | GPLv2+     |
| freepbx_ha          | 13.0.11     | Enabled                           | Commercial |
| fw_langpacks        | 12.0.7      | Enabled                           | GPLv3+     |
| hotelwakeup         | 13.0.17.1   | Enabled                           | GPLv2      |
| iaxsettings         | 13.0.6.6    | Enabled                           | AGPLv3     |
| infoservices        | 13.0.1.2    | Enabled                           | GPLv2+     |
| irc                 | 2.11.0.7    | Enabled                           | GPLv3+     |
| ivr                 | 13.0.27.6   | Enabled                           | GPLv3+     |
| languages           | 13.0.6      | Enabled                           | GPLv3+     |
| logfiles            | 13.0.10.4   | Enabled                           | GPLv3+     |
| manager             | 13.0.2.5    | Enabled                           | GPLv2+     |
| miscapps            | 13.0.3.1    | Enabled                           | GPLv3+     |
| miscdests           | 13.0.5      | Enabled                           | GPLv3+     |
| motif               | 13.0.4      | Enabled                           | GPLv3+     |
| music               | 13.0.22.3   | Enabled                           | GPLv3+     |
| outroutemsg         | 13.0.2.1    | Enabled                           | GPLv3+     |
| paging              | 13.0.26.5   | Enabled                           | GPLv3+     |
| pagingpro           | 13.0.19.7   | Enabled                           | Commercial |
| parking             | 13.0.19.7   | Enabled                           | GPLv3+     |
| parkpro             | 13.0.30.12  | Enabled                           | Commercial |
| pbdirectory         | 2.11.0.6    | Enabled                           | GPLv3+     |
| phonebook           | 13.0.6.1    | Enabled                           | GPLv3+     |
| phpagiconf          | 2.11.0.2    | Enabled                           | GPLv3+     |
| phpinfo             | 13.0.2      | Enabled                           | GPLv2+     |
| pinsets             | 13.0.8      | Enabled                           | GPLv3+     |
| pinsetspro          | 13.0.9.4    | Enabled                           | Commercial |
| pm2                 |             | Not Installed (Locally available) | AGPLv3+    |
| pms                 | 13.0.2.8    | Enabled                           | Commercial |
| presencestate       | 13.0.8      | Enabled                           | GPLv3+     |
| printextensions     | 13.0.3.1    | Enabled                           | GPLv3+     |
| queuemetrics        | 2.11.0.3    | Enabled                           | GPLv3+     |
| queueprio           | 13.0.2      | Enabled                           | GPLv3+     |
| queues              | 13.0.34.8   | Enabled                           | GPLv2+     |
| recording_report    | 13.0.24.8   | Enabled                           | Commercial |
| recordings          | 13.0.30.12  | Enabled                           | GPLv3+     |
| restapi             | 13.0.21.1   | Enabled                           | AGPLv3     |
| restapps            |             | Not Installed (Locally available) | Commercial |
| ringgroups          | 13.0.23.2   | Enabled                           | GPLv3+     |
| sangomacrm          | 13.0.4.25   | Enabled                           | Commercial |
| setcid              | 13.0.6.2    | Enabled                           | GPLv3+     |
| sipsettings         | 13.0.26.2   | Enabled                           | AGPLv3+    |
| sipstation          | 13.0.14.7   | Enabled                           | Commercial |
| sms                 | 13.0.12.3   | Enabled                           | Commercial |
| sng_mcu             | 13.0.5      | Enabled                           | Commercial |
| soundlang           | 13.0.24.5   | Enabled                           | GPLv3+     |
| speeddial           | 2.11.0.4    | Enabled                           | GPLv3+     |
| superfecta          | 13.0.4.5    | Enabled                           | GPLv2+     |
| sysadmin            | 13.0.76.2   | Enabled                           | Commercial |
| timeconditions      | 13.0.34.8   | Enabled                           | GPLv3+     |
| trunkbalance        | 1.1.3       | Enabled                           | GPLv2+     |
| tts                 | 13.0.10     | Enabled                           | GPLv3+     |
| ttsengines          | 13.0.7.3    | Enabled                           | AGPLv3     |
| ucp                 | 13.0.42.6   | Enabled                           | AGPLv3+    |
| ucpnode             | 13.0.34.9   | Enabled                           | Commercial |
| userman             | 13.0.76.38  | Enabled                           | AGPLv3+    |
| vmblast             | 13.0.8      | Enabled                           | GPLv3+     |
| vmnotify            | 13.0.21     | Enabled                           | Commercial |
| voicemail           | 13.0.54.18  | Enabled                           | GPLv3+     |
| voicemail_report    | 13.0.13.3   | Enabled                           | Commercial |
| vqplus              | 13.0.38     | Enabled                           | Commercial |
| weakpasswords       | 13.0.2      | Enabled                           | GPLv3+     |
| webcallback         | 13.0.11.2   | Enabled                           | Commercial |
| webrtc              | 13.0.32.8   | Enabled                           | GPLv3+     |
| xmpp                | 13.0.17.13  | Enabled                           | AGPLv3     |
| zulu                | 13.0.54.26  | Enabled                           | Commercial |
+---------------------+-------------+-----------------------------------+------------+

You seem to have an issue connecting to the NPM repository.

What it is its address so I can see if I can ping it?

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.

Ah that is fine. I though it was from my end but I guess it is not.

It IS from your end. Our proxy server is only a fallback.

You can try this:

rm -Rf /home/asterisk/{.npm,.npmrc,.node-gyp,.package_cache}
rm -Rf /var/www/html/admin/modules/pm2/node/node_modules
fwconsole ma install pm2
1 Like

I’m sorry, I misunderstood what you said. As it seems its from my end.

[[email protected] ~]# 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.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.