Unable to locate the FreePBX BMO Class 'Pm2'

HI All,

After an update was completed, I got this error:

Unable to locate the FreePBX BMO Class 'Pm2’A required module might be disabled or uninstalled. Recommended steps (run from the CLI): 1) fwconsole ma install pm2 2) fwconsole ma enable pm2

I followed the instruction and I got another error:

[[email protected] ~]# fwconsole ma install pm2

locale: Cannot set LC_CTYPE to default locale: No such file or directory

ERROR: npm is known not to run on Node.js v8.16.0

You’ll need to upgrade to a newer Node.js version in order to use this

version of npm. You can find the latest version at https://nodejs.org/

Node Package Manager is not installed

Unable to install module pm2:

  • Failed to run installation scripts

I tried to install node.js using command curl -sL https://rep.nodesource.com/setup_10.x | sudo -E bash - , I got another error. See below:

[[email protected] ~]# curl -sL https://rpm.nodesource.com/setup_11.x | sudo -E bash -

================================================================================

                          DEPRECATION WARNING                            

Node.js 11.x is no longer actively supported!

You will not receive security or critical stability updates for this version.

You should migrate to a supported version of Node.js as soon as possible.
Use the installation script that corresponds to the version of Node.js you
wish to install. e.g.

Please see GitHub - nodejs/Release: Node.js Release Working Group for details about which
version may be appropriate for you.

The NodeSource Node.js distributions repository contains
information both about supported versions of Node.js and supported Linux
distributions. To learn more about usage, see the repository:
GitHub - nodesource/distributions: NodeSource Node.js Binary Distributions

================================================================================

Continuing in 20 seconds …

Installing the NodeSource Node.js 11.x repo…

Inspecting system…

  • rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release
  • uname -m

You don’t appear to be running a supported version of Enterprise Linux. Please contact NodeSource at Issues · nodesource/distributions · GitHub if you think this is incorrect or would like your architecture to be considered for support. Include your ‘distribution package’ name: sangoma-release-7-8.2003.3.el7.sangoma.x86_64.

Can someone help me on how I can upgrade Node.js? Currently, this incident is impacting on Zulu and our call agents cannot resolve issues for customers.

In addition, fwconsole ma updateall gave this error below

[[email protected] ~]# fwconsole ma updateall
locale: Cannot set LC_CTYPE to default locale: No such file or directory
No repos specified, using: [standard,commercial] from last GUI settings

Module(s) requiring upgrades: xmpp, zulu
Upgrading module 'xmpp' from 14.0.1.21 to 14.0.1.21
Downloading module 'xmpp'
Processing xmpp
Verifying local module download...Verified
Extracting...Done
Download completed in 0 seconds
Detected Missing Dependency of: pm2 13.0.3.8
Found local Dependency of: pm2 13.0.7.2
Installing Missing Dependency of: pm2 13.0.3.8
ERROR: npm is known not to run on Node.js v8.16.0
You'll need to upgrade to a newer Node.js version in order to use this
version of npm. You can find the latest version at https://nodejs.org/
Node Package Manager is not installed
The following error(s) occured:
 - Failed to run installation scripts
Unable to resolve dependencies for module xmpp:
Updating Hooks...Done
Upgrading module 'zulu' from 14.0.58.11 to 14.0.58.11
Downloading module 'zulu'
Processing zulu
Verifying local module download...Verified
Extracting...Done
Download completed in 1 seconds
Detected Missing Dependency of: pm2 13.0.4.1
Found local Dependency of: pm2 13.0.7.2
Installing Missing Dependency of: pm2 13.0.4.1
ERROR: npm is known not to run on Node.js v8.16.0
You'll need to upgrade to a newer Node.js version in order to use this
version of npm. You can find the latest version at https://nodejs.org/
Node Package Manager is not installed
The following error(s) occured:
 - Failed to run installation scripts
Unable to resolve dependencies for module zulu:
Updating Hooks...Done
All upgrades completed successfully!
Updating Hooks...Done

In Self_Helper.class.php line 213:
                                                                                                           
  Unable to locate the FreePBX BMO Class 'Pm2'A required module might be disabled or uninstalled. Recomme  
  nded steps (run from the CLI): 1) fwconsole ma install pm2 2) fwconsole ma enable pm2                    
                                                                                                           

moduleadmin [-f|--force] [-d|--debug] [--edge] [--ignorecache] [--stable] [--color] [--skipchown] [-e|--autoenable] [--skipdisabled] [--snapshot SNAPSHOT] [--format FORMAT] [-R|--repo REPO] [-t|--tag TAG] [--sendemail] [--onlystdout] [--] [<args>]...

Please advice on what to do. it is urgent!

Hi @bholler ,

Try to remove all of the cache data for node and then install the module again.

fwconsole ma remove pm2 --force
rm -rf /home/asterisk/.package_cache/npm/
rm -rf /home/asterisk/.npm
fwconsole ma downloadinstall pm2 

See the outcome below:

fwconsole ma downloadinstall pm2 
locale: Cannot set LC_CTYPE to default locale: No such file or directory
No repos specified, using: [standard,commercial] from last GUI settings

Downloading module 'pm2'
Processing pm2
Verifying local module download...Verified
Extracting...Done
Download completed in 4 seconds
ERROR: npm is known not to run on Node.js v8.16.0
You'll need to upgrade to a newer Node.js version in order to use this
version of npm. You can find the latest version at https://nodejs.org/
Node Package Manager is not installed
Unable to install module pm2:
 - Failed to run installation scripts
Updating Hooks...Done
npm -v

See the output below

 npm -v
ERROR: npm is known not to run on Node.js v8.16.0
You'll need to upgrade to a newer Node.js version in order to use this
version of npm. You can find the latest version at https://nodejs.org/

@pramarajan

the pm2 package is being stalled by the dependency. Kindly advice on the right version and the steps to install it.

did you tried to update the npm version manually?

My 16 system shows below versions -

[[email protected] ~]# npm -v 6.4.1 [[email protected] ~]# node -v v8.16.0

do not have any handy 14 system right now so you can check whats the running npn and node version in working 14 system and compare with yours.

@kgupta2,

Not sure I that manually. I had an in complete module update. so I ran “yum complete-installation command”. Afterward issued “fwconsole ma install pm2”. Since then, the error remains the same.

However, I came across this command to check list of packages, I guess the npm version is listed below:

[[email protected] /]# sudo yum list | grep npm
Failed to set locale, defaulting to C
nodejs-fstream-npm.noarch                0.1.5-1.el7              sng-epel      
nodejs-npm-registry-client.noarch        0.2.28-3.el7             sng-epel      
nodejs-npm-user-validate.noarch          0.0.3-1.el7              sng-epel      
nodejs-npmconf.noarch                    0.1.3-1.el7              sng-epel      
nodejs-npmlog.noarch                     0.0.4-3.el7              sng-epel      
nodejs-silent-npm-registry-client.noarch 0.0.1-2.el7              sng-epel      
npm.x86_64                               1:3.10.10-1.6.17.1.1.el7 sng-epel  

what do you think?

Can someone tell me what this means?

sudo yum install -y npm
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
Package 1:npm-3.10.10-1.6.17.1.1.el7.x86_64 is obsoleted by 2:nodejs-8.16.0-1.11.x86_64 which is already installed
Nothing to do

I am abit confused ATM.

PBXact is such as terrible system. How can a upgrade crash the entire system. This is so absurd

The PBXact POMPs includes support. I recommend you open a ticket and take advantage of it.
https://support.sangoma.com/

The device is about 2 years old. We have not renewed the annual license. There is no time for that now. I need to get the device up ASAP

I need your help urgently. If you have a running FreePBX version 14. Kindly help me to copy npm from the directory listed below.

/usr/lib/node_modules/npm (version 6.4.1)

Based on many posts on this forum, this is the technique proven to have worked. I look forward to someone helping out ASAP. - (Reference) Unable to update PM2 module - #4 by fdanard