For some weird reason the very short “internal name” of that module (pm2) is used when dependencies are shown instead of its description (“Process Management”).
I never noticed and it most likely always does that but this time the module name does not help much figure out what to install…
# fwconsole ma downloadinstall pm2
No repos specified, using: [standard,extended,unsupported] from last GUI settings
Starting pm2 download..
Processing pm2
Verifying local module download...Verified
Extracting...Done
Module pm2 successfully downloaded
sh: 1: node: not found
Node is not installed
Unable to install module pm2:
- Failed to run installation scripts
Updating Hooks...Done
# fwconsole ma downloadinstall nodejs
No repos specified, using: [standard,extended,unsupported] from last GUI settings
Starting nodejs download..
The following error(s) occured:
- Retrieved Module XML Was Empty
Just figured out that it is an OS level package. In my case:
apt-get install nodejs
apt-get install node
But alas still no go on pm2:
# fwconsole ma downloadinstall pm2
No repos specified, using: [standard,extended,unsupported] from last GUI settings
Starting pm2 download..
Processing pm2
Verifying local module download...Verified
Extracting...Done
Module pm2 successfully downloaded
sh: 1: node: not found
Node is not installed
Unable to install module pm2:
- Failed to run installation scripts
Updating Hooks...Done
Found a hint that the correct package for Raspian is nodejs-legacy. After removing the first two and installing that I get:
# fwconsole ma downloadinstall pm2
No repos specified, using: [standard,extended,unsupported] from last GUI settings
Starting pm2 download..
Processing pm2
Verifying local module download...Verified
Extracting...Done
Module pm2 successfully downloaded
Node version is: 0.10.29 requirement is 0.12.18. Run 'yum upgrade nodejs' from the CLI as root
Unable to install module pm2:
- Failed to run installation scripts
Updating Hooks...Done
Sorry but you need to install nodejs 0.12.18 or higher. This is most easily accomplished by using the FreePBX Distro. Since you are on a Raspian there’s not much we can do other than tell you that you need 0.12.18 or higher.
Node JS is not a module in FreePBX. It is a requirement outside of that. When you use systems that are not the FreePBX Distro you will most likely have to build things manually or find them somewhere else.
Having some similar trouble installing the proper version of nodejs to be able to install pm2.
Using CentOS 6.9 and FreePBX 13
I used these instructions to install nodejs
But when I try and run:
#fwconsole ma downloadinstall pm2
No repos specified, using: [standard,extended,unsupported,commercial] from last GUI settings
Starting pm2 download..
Processing pm2
Verifying local module download...Verified
Extracting...Done
Module pm2 successfully downloaded
Node version is: 0.10.48 requirement is 0.12.18. Run 'yum upgrade nodejs' from the CLI as root
Unable to install module pm2:
- Failed to run installation scripts
Updating Hooks...Done
#yum upgrade nodejs
Loaded plugins: fastestmirror, security
Setting up Upgrade Process
Loading mirror speeds from cached hostfile
* epel: fedora-epel.mirror.lstn.net
No Packages marked for Update
I can see that I don’t have the right version of nodjs but can’t figure out how to upgrade. This is more of OS issue than a freepbx issue but perhaps someone could nudge me in the right direction?
module.js:338
throw err;
^
Error: Cannot find module 'debug’
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. (/var/www/html/admin/modules/pm2/node/node_module
s/pm2/constants.js:7: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 Module.require (module.js:365:17)
I stumbled on this problem with some of my servers. For some reason the nodejs modules are not downloaded with the rest of the PM2 module (especially the debug module). I guess it is a timeout of one of the HTTP servers somewhere in the way because many of my Freepbx servers are being upgraded fine with the PM2 module.
What I am doing to bypass this problem is just copying a working PM2 module directory from another server with SCP and then I am “installing” the PM2 module.
Let us assume that you have a working and updated PM2 module with an ip address of 1.1.1.1 and a non working Freepbx server with an ip address of 2.2.2.2
Here are the steps:
Remove the PM2 module directory from the non working Freepbx (2.2.2.2) rm -rf /var/www/html/admin/modules/pm2
Copy the working PM2 directory from 1.1.1.1 to 2.2.2.2 scp -r /var/www/html/admin/modules/pm2 [email protected]:/var/www/html/admin/modules/
Install the PM2 module on 2.2.2.2 after the copy of the working module fwconsole ma install pm2
Upgrade the rest of the modules on 2.2.2.2 fwconsole ma upgradeall
Reload the Freepbx framework on 2.2.2.2 fwconsole reload
Restart the Freepbx framework fwconsole stop && fwconsole start