How to update/upgrade Node.JS version ?
See original GitHub issueI’m having great trouble upgrading Node.JS on my RPI 3 B+. I’ve been on the web for a day, trying almost all solutions but I’ve yet to get it upgraded.
Here’s a few of what I’ve tried : all to no avail
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - $ sudo apt-get install -y nodejs
package-lock.json npm install npm rebuild
npm cache clean -f npm install -g n n stable
After entering these commands they seem to be doing their job, however whenever I enter “node -v” it always says I’m still on 8.2.1 . Why why why ?
I’m concerned over whether my accessories / platforms will still work after NodeJS is upgraded. I’m trying to install Ring plugin but it requires version 8.3.0 , while mine is 8.2.1 .
I’m also running MagicMirror on the same RPI . Think it uses pm2 . If I eventually successfully upgraded NodeJS , will either MagicMirror / Homebridge work as usual ?
Thank you very much for anyone that has an answer to this … I just need a correct list of steps/commands to upgrade NodeJS safely . I’m getting variations of the method everywhere but none of which seem to work . If Homebridge has to be reinstalled after upgrading NodeJS, what’s the correct procedure to do it in this case?
My apologies for not being able to provide the Homebridge Log / Command Output. Through multiple tries of upgrading NodeJS a lot of plugins went wrong already , it has taken me ages to get things back to yesterday . For now Homebridge autostart on boot doesn’t work anymore . I don’t want to mess things up further by redoing the same steps again …
Versions
- Homebridge:
homebridge --version
: 0.4.49 - Node:
node --version
: v8.2.1 - OS: Windows 10
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (1 by maintainers)
Top GitHub Comments
Adding a link to the relevant wiki article as this issue is one of the top results in Google.
https://github.com/homebridge/homebridge/wiki/How-To-Update-Node.js
Okay so … I’ve finally found a way to upgrade successfully !!
sudo npm cache clean -f sudo npm install -g n sudo n 8.3.0
What on earth … Took me 2 days to do so. Now it has upgraded successfully. Everything is back to normal and every plugin in Homebridge still works as per normal.
However with success comes disappointments, the Ring plugin works now but I can’t get it to discover and add my Ring Doorbell. Wtf … Guess it’s a problem for another day 😞
Thank you very much to all that have helped. I really appreciate the fast responses 😄😃