Page 1 of 4

Upgrading to NodeJS version 6

PostPosted: Fri Sep 30, 2016 10:30 am
by webdeck
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

Re: Upgrading to NodeJS version 6

PostPosted: Fri Sep 30, 2016 1:29 pm
by durosity
That's pretty cool. If only there was a package to pull securityspy feeds through to it :D

Re: Upgrading to NodeJS version 6

PostPosted: Tue Oct 18, 2016 10:16 am
by Umtauscher
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

Re: Upgrading to NodeJS version 6

PostPosted: Tue Oct 18, 2016 10:19 am
by Umtauscher
Sorry - seems to be a problem with the homebridge-harmonyhub plugin.
When I disable that, my indigo goes through.

Still hoping for ideas....

Re: Upgrading to NodeJS version 6

PostPosted: Fri Nov 11, 2016 2:51 pm
by Different Computers
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.

Re: Upgrading to NodeJS version 6

PostPosted: Fri Nov 11, 2016 3:07 pm
by Different Computers
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.

Re: Upgrading to NodeJS version 6

PostPosted: Fri Nov 11, 2016 11:09 pm
by webdeck
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

Re: Upgrading to NodeJS version 6

PostPosted: Sun Dec 11, 2016 8:11 pm
by dnomode
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

Re: Upgrading to NodeJS version 6

PostPosted: Sun Dec 11, 2016 8:28 pm
by Colorado4Wheeler
Did you uninstall everything first?

Re: Upgrading to NodeJS version 6

PostPosted: Sun Dec 11, 2016 8:36 pm
by dnomode
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

Re: Upgrading to NodeJS version 6

PostPosted: Mon Dec 12, 2016 12:07 am
by MarcoGT
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)

Re: Upgrading to NodeJS version 6

PostPosted: Mon Dec 12, 2016 5:55 pm
by dnomode
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

Re: Upgrading to NodeJS version 6

PostPosted: Mon Dec 12, 2016 6:06 pm
by Colorado4Wheeler
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.

Re: Upgrading to NodeJS version 6

PostPosted: Mon Dec 12, 2016 6:24 pm
by dnomode
So, do I just need to uninstall npm or is there more to it?


Sent from my iPhone using Tapatalk

Re: Upgrading to NodeJS version 6

PostPosted: Mon Dec 12, 2016 9:26 pm
by Colorado4Wheeler
Look at the first post in this thread, you need to uninstall everything.