Upgrading to NodeJS version 6

Posted on
Fri Sep 30, 2016 10:30 am
webdeck offline
Posts: 359
Joined: May 07, 2005

Upgrading to NodeJS version 6

The latest version of homebridge added support for cameras that use the RTSP protocol. But it also required using NodeJS version 6 instead of version 4. So, you will get errors if you try to upgrade to the latest version of homebridge, unless you upgrade to NodeJS 6.

If you followed my installation instructions, then here is how to upgrade:

Code: Select all
sudo port uninstall npm2
sudo port uninstall nodejs4
sudo rm -fr /opt/local/lib/node_modules/
sudo port install nodejs6
sudo port install npm3
sudo npm install -g homebridge
sudo npm install -g homebridge-indigo


If you installed any other homebridge plugins, you would need to reinstall those as well.

Finally, you need to restart your homebridge.

-Mike

Posted on
Fri Sep 30, 2016 1:29 pm
durosity offline
User avatar
Posts: 3109
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Upgrading to NodeJS version 6

That's pretty cool. If only there was a package to pull securityspy feeds through to it :D

Computer says no.

Posted on
Tue Oct 18, 2016 10:16 am
Umtauscher offline
User avatar
Posts: 205
Joined: Oct 03, 2014

Re: Upgrading to NodeJS version 6

Hi, unfortuately the upgrade broke my installation:

Everything installed without errors. Now when I start homebridge, it terminates with the following error:

[18.10.2016, 18:12:29] [My Indigo Server] Indigo request: http://127.0.0.1:8176/devices/Fenster%2 ... ature.json
/opt/local/lib/node_modules/homebridge-harmonyhub/node_modules/harmonyhubjs-client/lib/login/hub.js:59
if (response.identity && response.identity !== undefined) {
^

TypeError: Cannot read property 'identity' of undefined

Any ideas?
TIA
Wilhelm

Posted on
Tue Oct 18, 2016 10:19 am
Umtauscher offline
User avatar
Posts: 205
Joined: Oct 03, 2014

Re: Upgrading to NodeJS version 6

Sorry - seems to be a problem with the homebridge-harmonyhub plugin.
When I disable that, my indigo goes through.

Still hoping for ideas....

Posted on
Fri Nov 11, 2016 2:51 pm
Different Computers offline
User avatar
Posts: 1369
Joined: Jan 02, 2016
Location: East Coast

Re: Upgrading to NodeJS version 6

Following your instructions I see
Code: Select all
2doghill:Documents macadmin$ sudo npm install -g homebridge
/opt/local/bin/homebridge -> /opt/local/lib/node_modules/homebridge/bin/homebridge

> mdns@2.3.3 install /opt/local/lib/node_modules/homebridge/node_modules/mdns
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/macadmin/.node-gyp/6.9.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/local/lib/node_modules/homebridge/node_modules/mdns/.node-gyp"


Is this anything I should worry about? Homebridge started properly after the installs and is running.

Refugee from SmartThings and so happy to be on Indigo now.
Sierra on an i5 running Harmony Hub, Hue, Security Camera, DomoPad, EPS Device Extensions EPS Smart Dimmer, MatplotLib, Plex, Scale Adapters, uniFiAP, Wunderground.

Posted on
Fri Nov 11, 2016 3:07 pm
Different Computers offline
User avatar
Posts: 1369
Joined: Jan 02, 2016
Location: East Coast

Re: Upgrading to NodeJS version 6

Here's what you have to do if you don't normally mess with ports, npm, or nodejs. Like if you haven't touched it since you first installed homebridge. Like me.

There are many steps, and the responses you get from attempting don't mention things you might not know, like how all the commands require sudo.

I'm attaching it here because it's a lot.
Attachments
npm update.txt
(22.37 KiB) Downloaded 67 times

Refugee from SmartThings and so happy to be on Indigo now.
Sierra on an i5 running Harmony Hub, Hue, Security Camera, DomoPad, EPS Device Extensions EPS Smart Dimmer, MatplotLib, Plex, Scale Adapters, uniFiAP, Wunderground.

Posted on
Fri Nov 11, 2016 11:09 pm
webdeck offline
Posts: 359
Joined: May 07, 2005

Re: Upgrading to NodeJS version 6

Different Computers wrote:
Following your instructions I see
Code: Select all
2doghill:Documents macadmin$ sudo npm install -g homebridge
/opt/local/bin/homebridge -> /opt/local/lib/node_modules/homebridge/bin/homebridge

> mdns@2.3.3 install /opt/local/lib/node_modules/homebridge/node_modules/mdns
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/macadmin/.node-gyp/6.9.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/local/lib/node_modules/homebridge/node_modules/mdns/.node-gyp"


Is this anything I should worry about? Homebridge started properly after the installs and is running.


It is safe to ignore that warning.

-Mike

Posted on
Sun Dec 11, 2016 8:11 pm
dnomode offline
Posts: 279
Joined: Apr 12, 2008
Location: Huntington Beach

Re: Upgrading to NodeJS version 6

I tried to upgrade and got the following after running sudo port install nodejs6:

Code: Select all
Edmonds-Mac-mini:~ edmond$ sudo port install nodejs6
--->  Computing dependencies for nodejs6
--->  Installing nodejs6 @6.9.1_0
Error: org.macports.install for port nodejs6 returned: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nodejs6/nodejs6/work/destroot
Please see the log file for port nodejs6 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nodejs6/nodejs6/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port nodejs6 failed
Edmonds-Mac-mini:~ edmond$


What should I do?
Edmond

Posted on
Sun Dec 11, 2016 8:28 pm
Colorado4Wheeler offline
User avatar
Posts: 1130
Joined: Jul 20, 2009
Location: Colorado

Re: Upgrading to NodeJS version 6

Did you uninstall everything first?

My Modest Contributions to Indigo:

Homebridge Buddy | Room-O-Matic | Smart Dimmer | Scene Toggle | Mac Commander | Security Manager | Device Extensions | LCD Creator | Control Page Keypad | Powermiser

Check Them Out Here

Posted on
Sun Dec 11, 2016 8:36 pm
dnomode offline
Posts: 279
Joined: Apr 12, 2008
Location: Huntington Beach

Re: Upgrading to NodeJS version 6

I had it running before with Indigo 6. Just undated to Indigo 7 a couple of weeks ago and tried to use Siri today and noticed that it was not working any longer. So I tried to the update. I uninstalled npm2 and nodejs4, then ran sudo rm -fr /opt/local/lib/node_modules/ without any error message until trying to run sudo port install nodejs6. What you think?


Sent from my iPhone using Tapatalk

Posted on
Mon Dec 12, 2016 12:07 am
MarcoGT offline
Posts: 524
Joined: Sep 11, 2014
Location: Germany

Re: Upgrading to NodeJS version 6

I had the same problem.
Try the following:

Code: Select all
sudo port -v selfupdate


If it doesn't help, try:

Code: Select all
sudo port clean <name_of_the_port> (for example, nodejs)

Posted on
Mon Dec 12, 2016 5:55 pm
dnomode offline
Posts: 279
Joined: Apr 12, 2008
Location: Huntington Beach

Re: Upgrading to NodeJS version 6

MarcoGT wrote:
I had the same problem.
Try the following:

Code: Select all
sudo port -v selfupdate


If it doesn't help, try:

Code: Select all
sudo port clean <name_of_the_port> (for example, nodejs)

Thanks for your help. That kind of worked. Now my system lets me run the below with no errors:
Code: Select all
sudo port install nodejs6

However I get the following error when trying the next step:
Code: Select all
Edmonds-Mac-mini:~ edmond$ sudo port install npm3
--->  Computing dependencies for npm3
--->  Fetching archive for npm3
--->  Attempting to fetch npm3-3.10.9_0.darwin_12.noarch.tbz2 from https://packages.macports.org/npm3
--->  Attempting to fetch npm3-3.10.9_0.darwin_12.noarch.tbz2.rmd160 from https://packages.macports.org/npm3
--->  Installing npm3 @3.10.9_0
--->  Activating npm3 @3.10.9_0
Error: org.macports.activate for port npm3 returned: Image error: /opt/local/bin/npm is being used by the active npm port.  Please deactivate this port first, or use 'port -f activate npm3' to force the activation.
Please see the log file for port npm3 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_npm3/npm3/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port npm3 failed
Edmonds-Mac-mini:~ edmond$


What should I try next?
Edmond

Posted on
Mon Dec 12, 2016 6:06 pm
Colorado4Wheeler offline
User avatar
Posts: 1130
Joined: Jul 20, 2009
Location: Colorado

Re: Upgrading to NodeJS version 6

The entire upgrade process is built on uninstalling EVERYTHING first, then reinstalling it to get NodeJS 6. I would just start from scratch and uninstall everything - and watch the messages, it may complain when you try to uninstall that you didn't specify which version - this means you likely have TWO versions and each one will need to be uninstalled using something like "npm uninstall npm @ 10.1.33", etc.

My Modest Contributions to Indigo:

Homebridge Buddy | Room-O-Matic | Smart Dimmer | Scene Toggle | Mac Commander | Security Manager | Device Extensions | LCD Creator | Control Page Keypad | Powermiser

Check Them Out Here

Posted on
Mon Dec 12, 2016 6:24 pm
dnomode offline
Posts: 279
Joined: Apr 12, 2008
Location: Huntington Beach

Re: Upgrading to NodeJS version 6

So, do I just need to uninstall npm or is there more to it?


Sent from my iPhone using Tapatalk

Posted on
Mon Dec 12, 2016 9:26 pm
Colorado4Wheeler offline
User avatar
Posts: 1130
Joined: Jul 20, 2009
Location: Colorado

Re: Upgrading to NodeJS version 6

Look at the first post in this thread, you need to uninstall everything.

My Modest Contributions to Indigo:

Homebridge Buddy | Room-O-Matic | Smart Dimmer | Scene Toggle | Mac Commander | Security Manager | Device Extensions | LCD Creator | Control Page Keypad | Powermiser

Check Them Out Here

Who is online

Users browsing this forum: No registered users and 1 guest