Issue updating pm2

I can’t seem to update pm2. I’ve removed it and then reintalled it. When I reinstall it I receive the following error:

 fwconsole ma downloadinstall pm2
No repos specified, using: [standard,commercial,extended] 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: fa2348032788d5067b56972347177c79
[npm-cache] [INFO] [npm] running [npm install]...
npm ERR! not a package /tmp/npm-6614-b0f681a2/mirror1.freepbx.org/npm/pm2-2.10.6.tgz
npm ERR! Linux 2.6.32-642.6.2.el6.i686
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.18
npm ERR! npm  v2.15.11
npm ERR! path /tmp/npm-6614-b0f681a2/unpack-450b6db08e2d/package.json
npm ERR! code ENOENT
npm ERR! errno -2

npm ERR! enoent ENOENT, open '/tmp/npm-6614-b0f681a2/unpack-450b6db08e2d/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/html/admin/modules/pm2/node/npm-debug.log
[npm-cache] [ERROR] [npm] error running npm install
[npm-cache] [ERROR] error installing dependencies

Finished updating libraries!

There was an error installing. Please review the install log. (/var/www/html/admin/modules/pm2/node/logs/install.log)
Unable to install module pm2:
 - Failed to run installation scripts

What does /var/www/html/admin/modules/pm2/node/npm-debug.log say?

Try

yum clean all
yum update -y
fwconsole reload
fwconsole chown
fwconsole ma upgradeall
fwconsole reload
 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose readDependencies loading dependencies from /var/www/html/admin/modules/pm2/node/package.json
5 verbose install where, deps [ '/var/www/html/admin/modules/pm2/node', [ 'pm2' ] ]
6 verbose install where, peers [ '/var/www/html/admin/modules/pm2/node', [] ]
7 verbose installManyTop reading for lifecycle /var/www/html/admin/modules/pm2/node/package.json
8 info preinstall [email protected]
9 verbose readDependencies loading dependencies from /var/www/html/admin/modules/pm2/node/package.json
10 silly cache add args [ 'pm2@http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz', null ]
11 verbose cache add spec pm2@http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz
12 silly cache add parsed spec { raw: 'pm2@http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz',
12 silly cache add   scope: null,
12 silly cache add   name: 'pm2',
12 silly cache add   rawSpec: 'http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz',
12 silly cache add   spec: 'http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz',
12 silly cache add   type: 'remote' }
13 silly mapToRegistry name pm2@http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz
14 silly mapToRegistry using default registry
15 silly mapToRegistry registry https://registry.npmjs.org/
16 silly mapToRegistry data { raw: 'pm2@http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz',
16 silly mapToRegistry   scope: null,
16 silly mapToRegistry   name: 'pm2',
16 silly mapToRegistry   rawSpec: 'http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz',
16 silly mapToRegistry   spec: 'http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz',
16 silly mapToRegistry   type: 'remote' }
17 silly mapToRegistry uri http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz
18 verbose addRemoteTarball http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz not in flight; adding
19 verbose addRemoteTarball [ 'http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz', null ]
20 info retry fetch attempt 1 at 8:48:45 AM
21 info attempt registry request try #1 at 8:48:45 AM
22 http fetch GET http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz
23 verbose request id 32655524f8cb83c0
24 http fetch 200 http://mirror1.freepbx.org/npm/pm2-2.10.6.tgz
25 silly fetchAndShaCheck shasum 2a399302ac47aa29202c834ed7bcce6580cfcc33
26 verbose addTmpTarball /tmp/npm-6614-b0f681a2/mirror1.freepbx.org/npm/pm2-2.10.6.tgz not in flight; adding
27 verbose correctMkdir /home/asterisk/.npm correctMkdir not in flight; initializing
28 verbose addTmpTarball validating metadata from /tmp/npm-6614-b0f681a2/mirror1.freepbx.org/npm/pm2-2.10.6.tgz
29 verbose tar unpack /tmp/npm-6614-b0f681a2/mirror1.freepbx.org/npm/pm2-2.10.6.tgz
30 verbose tar unpacking to /tmp/npm-6614-b0f681a2/unpack-450b6db08e2d
31 silly gentlyRm /tmp/npm-6614-b0f681a2/unpack-450b6db08e2d is being purged
32 verbose gentlyRm don't care about contents; nuking /tmp/npm-6614-b0f681a2/unpack-450b6db08e2d
33 silly gunzTarPerm modes [ '755', '644' ]
34 error not a package /tmp/npm-6614-b0f681a2/mirror1.freepbx.org/npm/pm2-2.10.6.tgz
35 verbose stack Error: ENOENT, open '/tmp/npm-6614-b0f681a2/unpack-450b6db08e2d/package.json'
35 verbose stack     at Error (native)
36 verbose cwd /var/www/html/admin/modules/pm2/node
37 error Linux 2.6.32-642.6.2.el6.i686
38 error argv "/usr/bin/node" "/usr/bin/npm" "install"
39 error node v0.12.18
40 error npm  v2.15.11
41 error path /tmp/npm-6614-b0f681a2/unpack-450b6db08e2d/package.json
42 error code ENOENT
43 error errno -2
44 error enoent ENOENT, open '/tmp/npm-6614-b0f681a2/unpack-450b6db08e2d/package.json'
44 error enoent This is most likely not a problem with npm itself
44 error enoent and is related to npm not being able to find a file.
45 verbose exit [ -2, true ]

Same error message after running the yum update command

How about this log?

/var/www/html/admin/modules/pm2/node/logs/install.log

[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: fa2348032788d5067b56972347177c79
[npm-cache] [INFO] [npm] running [npm install]...
npm ERR! not a package /tmp/npm-27017-f6118b88/mirror1.freepbx.org/npm/pm2-2.10.6.tgz
npm ERR! Linux 2.6.32-642.6.2.el6.i686
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.18
npm ERR! npm  v2.15.11
npm ERR! path /tmp/npm-27017-f6118b88/unpack-ca038229d739/package.json
npm ERR! code ENOENT
npm ERR! errno -2

npm ERR! enoent ENOENT, open '/tmp/npm-27017-f6118b88/unpack-ca038229d739/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/html/admin/modules/pm2/node/npm-debug.log
[npm-cache] [ERROR] [npm] error running npm install
[npm-cache] [ERROR] error installing dependencies

/tmp/npm-27017-f6118b88/mirror1.freepbx.org/npm/pm2-2.10.6.tg
/tmp/npm-27017-f6118b88/unpack-ca038229d739/package.json

Does these exist?

Yes to the first one. The second one doesn’t have package.json but it does have index.js in that file

I don’t know what to tell you.

Try

fwconsole ma downloadinstall pm2 --force

I appreciate your help. I guess it’s just not meant to be!

I had the same issue. I didnt need PM2 or any of its dependants. Removed them all.

1 Like

Interesting. So a system will be just fine without pm2? I’ll have to look for a list of modules that are dependent on pm2 and try this. Thank you

I think it handles mostly ucp, xmpp, rest apps. Virtual Queues Plus. On that specific server I wasnt using any of that. Buggy update. Ill wait a bit to patch other servers.

You can see exactly what pm2 handles with:

[root@lorne14-pro ~]# fwconsole pm2 --list
+------------------+-------+--------+----------+-------------------+-----+---------+
| Process Name     | PID   | Status | Restarts | Uptime            | CPU | Mem     |
+------------------+-------+--------+----------+-------------------+-----+---------+
| core-fastagi     | 18177 | online | 0        | 18 days, 23 hours | 0%  | 14.20MB |
| ucp              | 30488 | online | 55       | 18 days, 23 hours | 0%  | 44.41MB |
| qcallback        | 18804 | online | 0        | 18 days, 23 hours | 0%  | 6.08MB  |
| qcallback-events | 18892 | online | 0        | 18 days, 23 hours | 0%  | 22.94MB |
| xmpp             | 19070 | online | 0        | 18 days, 23 hours | 0%  | 77.62MB |
| zulu             | 29482 | online | 0        | 13 days, 3 hours  | 0%  | 91.89MB |
| restapps         | 16554 | online | 0        | 6 days, 20 hours  | 0%  | 15.30MB |
+------------------+-------+--------+----------+-------------------+-----+---------+

@mvogel4949 try the following:

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

Ensure there are no outbound restrictions in place at the router.

1 Like

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