Problems Upgrading UCP Node

Hi Jim,

I had the same problem this morning and was hoping somebody would respond to your thread.

This version of UCPNODE requires an upgrade to NPM. From the Linux command line:

npm install npm -g

I discovered this by attempting to force install the module from the CLI and got a version error telling me to run the above command. Did so, everything worked.

EDIT: Tagging @tm1000 to make sure he knows what’s up =)

I wrote the module and I wrote that message. No need to tag me. My point is all you have to do is run that message. The messages about missing deps can be safely ignored.

Oh >.> Thanks Andrew :blush: thought that it was a system message because it didn’t get pretty colors.

Tried to enable UCP NODE and the error comes back that npm is not installed. Yesterday I installed npm manually over the exisitng to ensure it is working. npm is working fine, it is not able to find the “upcnode” in the database. Is there a different name to this module. Thanks

Configs::Asterisk (Ver. 11.16.0) Installed with AsteriskNOW / FreePBX ios. I have just started on this system, I am completely new to this Asterisk – I have never fully installed this, and now I am trying to build a server at home as the media is getting uncontrollable …any help would be great…Thanks in anticipation…and this is my first post on asterisk, if at wrong forum, my apologies in advance.

There is a ton of confusion in here. Please read the inital post (scroll all the way up).

Some things to consider:

  1. UCP Node is a FreePBX module that uses node. It is not a part of NPM. You can’t install it through npm
  2. You should no longer be trying to update NPM separately
  3. You should be first removing nodejs AND npm, Then installing just nodejs
  4. Once that is done and works (npm --version) then you install ucp node:

.

amportal a ma remove ucpnode
amportal a ma download ucpnode
amportal a ma install ucpnode

I wish this could be easier but unfortunately it’s not. The next upgrade scripts will fix this for you as well.

1 Like

2 posts were split to a new topic: Cant login to UCP on FreePBX 13

After using the steps above to fix my FPBX13 appliance a few weeks ago, things somehow broke again. UCP Node is being disabled pending upgrade to the 13.0.12. That upgrade fails.

I redid the steps above thinking something may have reverted, and got a new error.

[root@localhost ~]# fwconsole ma install ucpnode --verbose
Installing/Updating Required Libraries. This may take a while… … … … … …
Finished updating libraries!
Generating CSS…Done
Module ucpnode successfully installed
Updating Hooks…Done

[Whoops\Exception\ErrorException]
filetype(): Lstat failed for /var/lib/asterisk/ucp/pids/ucp.pid

Exception trace:
() at /var/www/html/admin/libraries/Console/Chown.class.php:225
Whoops\Run->handleError() at n/a:n/a
filetype() at /var/www/html/admin/libraries/Console/Chown.class.php:225
FreePBX\Console\Command\Chown->singleChown() at /var/www/html/admin/libraries/C onsole/Chown.class.php:199
FreePBX\Console\Command\Chown->execute() at /var/www/html/admin/libraries/Conso le/Moduleadmin.class.php:532
FreePBX\Console\Command\Moduleadmin->setPerms() at /var/www/html/admin/librarie s/Console/Moduleadmin.class.php:869
FreePBX\Console\Command\Moduleadmin->handleArgs() at /var/www/html/admin/librar ies/Console/Moduleadmin.class.php:87
FreePBX\Console\Command\Moduleadmin->execute() at /var/www/html/admin/libraries /Composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:2 57
Symfony\Component\Console\Command\Command->run() at /var/www/html/admin/librari es/Composer/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/admin/li braries/Composer/vendor/symfony/console/Symfony/Component/Console/Application.ph p:195
Symfony\Component\Console\Application->doRun() at /var/www/html/admin/libraries /Composer/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /var/lib/asterisk/bin/fwconsole :132

ma [-f|–force] [-d|–debug] [–format="…"] [-R|–repo="…"] [args1] … [arg sN]

Works fine here. Perhaps try to uninstall it. Also remove the pid it’s talking about.

I’m also getting an error with the latest. I hadn’t updated the module in a few releases, coming from .9. I tried the above list of commands from Andrew and that didn’t work. I removed the module manually from the modules folder. At first, the web interface complained that it was broken (as expected), so then I used the web interface to uninstall, which wasn’t presented before, it had been listed as disabled and my only option was to enable and upgrade. Once uninstalled, it showed in the list as available and allowed for installation. I tried that, but it still generated an error. My error is Error: EACCES, mkdir ‘/home/asterisk/.npm/node-expat/2.3.11’. The suggestion is to run as root, but I’m already doing that.

As a follow up, I ran curl -L https://www.npmjs.com/install.sh | sh and then I was able to run

amportal a ma download ucpnode
amportal a ma install ucpnode

and it installed correctly. Slap me if this broke something else.

I saw you fixed your issue, I was having the same issue today where the log was showing a permissions error creating the directory.

I was moving from 13.0.11 to 13.0.12

Command line installation worked for me when logged in as root.

fwconsole ma uninstall ucpnode
fwconsole ma remove ucpnode
fwconsole ma download ucpnode
fwconsole ma install ucpnode

I had tried that but they didn’t help. I reinstalled npm because doing npm install npm -g actually generated an error during the update and corrupted npm to not run at all. I had tried Andrew’s full routine on Sep 4 above and it didn’t work for me.

[root@sip13 ~]# fwconsole ma uninstall ucpnode
The following error(s) occured:

  • Module not installed: cannot uninstall
    [root@sip13 ~]# fwconsole ma remove ucpnode
    Module ucpnode successfully deleted
    Updating Hooks…Done
    [root@sip13 ~]# fwconsole ma download ucpnode
    No repos specified, using: [standard,commercial,unsupported] from last GUI settings

Starting ucpnode download…
Processing ucpnode
Verifying local module download…Verified
Extracting…Done
Module ucpnode successfully downloaded
[root@sip13 ~]# fwconsole ma install ucpnode
sh: node: command not found
Node is not installed
Unable to install module ucpnode:

  • Failed to run installation scripts
    Updating Hooks…Done
    [root@sip13 ~]# yum install nodejs
    Loaded plugins: fastestmirror, kmod
    Setting up Install Process
    Loading mirror speeds from cached hostfile
    Resolving Dependencies
    –> Running transaction check
    —> Package nodejs.x86_64 0:0.10.40-1.shmz65.1.6 will be installed
    –> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
Package Arch Version Repository Size

Installing:
nodejs x86_64 0.10.40-1.shmz65.1.6 pbx 4.6 M

Transaction Summary

Install 1 Package(s)

Total download size: 4.6 M
Installed size: 16 M
Is this ok [y/N]: y
Downloading Packages:
nodejs-0.10.40-1.shmz65.1.6.x86_64.rpm | 4.6 MB 00:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : nodejs-0.10.40-1.shmz65.1.6.x86_64 1/1
Verifying : nodejs-0.10.40-1.shmz65.1.6.x86_64 1/1

Installed:
nodejs.x86_64 0:0.10.40-1.shmz65.1.6

Complete!
[root@sip13 ~]# yum install npm
Loaded plugins: fastestmirror, kmod
Setting up Install Process
Loading mirror speeds from cached hostfile
Package npm-1.3.6-5.el6.noarch is obsoleted by nodejs-0.10.40-1.shmz65.1.6.x86_64 which is already installed
Nothing to do
[root@sip13 ~]# fwconsole ma install ucpnode
Installing/Updating Required Libraries. This may take a while…
Finished updating libraries!
Generating CSS…Done
Module ucpnode successfully installed
Updating Hooks…Done

[Whoops\Exception\ErrorException]
filetype(): Lstat failed for /var/lib/asterisk/ucp/pids/ucp.pid

ma [-f|–force] [-d|–debug] [–format="…"] [-R|–repo="…"] [args1] … [argsN]

Remove this file and try again

Hi,

I have the last updates, But I can’t install UCP node.
This RPM is installed:
nodejs-0.10.40-1.shmz65.1.6.i686

when I run “amportal a ma install ucpnode” I receive this errors:
module.js:340
throw err;
^
Error: Cannot find module 'inherits’
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/lib/node_modules/npmconf/npmconf.js:3:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
Node Package Manager is not installed
Unable to install module ucpnode:

  • Failed to run installation scripts
    Updating Hooks…Done

Do you have any solution for this?

For those having an issue with nodejs and ucpnode in latest freepbx release 13.0.190.19-1.shmz65.1.53

Run the following in SSH/CLI interface

yum remove nodejs
yum remove npm
yum install nodejs

Once completed, reboot the server and go into the GUI to Admin-Module Admin and check for updates. Run the update process again until all modules are up to date. If you have dependencies that fail, you may have to 'yum remove bad dependency) ’ and then install again.

As always, make sure you have latest stable release of the distro if at all possible.

dont use amportal, use fwconsule moduleadmin uninstall package (module name without stars) or simply

fwconsole ma remove ucpnode

then

fwconsole ma install ucpnode

I tried the yum install ucpnode and received the following:

yum install ucpnode
Loaded plugins: fastestmirror, kmod
Setting up Install Process
Loading mirror speeds from cached hostfile
No package ucpnode available.
Error: Nothing to do

Any idea why it would say no package ucpnode available?

fwconsole ma not yum

It looks good until it errors out [exception] There is no process by that name

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
[npm-cache] [INFO] using /home/asterisk/.package_cache as cache directory
[npm-cache] [INFO] [composer] Dependency config file /var/www/html/admin/modules/ucpnode/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/ucpnode/node/package.json: e74d075b2a56bb1160978ef287801afe
[npm-cache] [INFO] [npm] cache exists
[npm-cache] [INFO] [npm] clearing installed dependencies at /var/www/html/admin/modules/ucpnode/node/node_modules
[npm-cache] [INFO] [npm] …cleared
[npm-cache] [INFO] [npm] retrieving dependencies from /home/asterisk/.package_cache/npm/2.15.11/e74d075b2a56bb1160978ef287801afe.tar.gz
[npm-cache] [INFO] [bower] Dependency config file /var/www/html/admin/modules/ucpnode/node/bower.json does not exist. Skipping install
[npm-cache] [INFO] [npm] done extracting
[npm-cache] [INFO] successfully installed all dependencies

Finished updating libraries!
Stopping old running processes…Done
Starting new UCP Node Process…

[Exception]
There is no process by that name