homebridge: Updating Node.js from vx.xx to v20.9.0...fails, node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
Analysis
Homebridge stuck on starting now.
Tried logging in and updating via SSH but not working.
Expected Behavior
Homebridge to work
Steps To Reproduce
sudo hb-service update-node
ℹ Updating Node.js from v18.18.2 to v20.9.0...
ℹ Target: /opt/homebridge
✔ Download complete.
✔ Cleaned up npm at at /opt/homebridge/lib/node_modules/npm
✔ Installed Node.js v20.9.0
ℹ Rebuilding for Node.js v20.9.0...
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
Error: Command failed: node -v
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
✖ ERROR: Failed Operation
⚠ Please restart Homebridge for the changes to take effect.
Logs
This is the error I get.
/usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
Configuration
Can't access to post.
Environment
- OS: Raspberry Pi
- Software: 1.61
- Node: 18.18.0 (tried to update to 20.04)
- npm: Not sure
Process Supervisor
hb-service
Additional Context
I have tried the following, all to no avail.
sudo apt-get install libstdc++6 sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade
Nothing works. I keep getting the same error repeated.
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Reactions: 1
- Comments: 93 (18 by maintainers)
Commits related to this issue
- Fixes for https://github.com/homebridge/homebridge/issues/3453 — committed to homebridge/homebridge-config-ui-x by NorthernMan54 8 months ago
- Fixes for https://github.com/homebridge/homebridge/issues/3453 (#1602) — committed to homebridge/homebridge-config-ui-x by NorthernMan54 8 months ago
What helped me to get back to 18.18.2 have been the following steps:
Uninstall nodejs 20.9.0 (installation done by using nodesource)
sudo apt-get purge nodejs
Following the installation steps like described in nodesource
No need for starting from scratch!
I had the same issue. the only way for me was to get back to Node 18.18.0
I’ve asked the ChatGPT-4 😃
Removing and Reinstalling a Specific Version of Node.js on Raspberry Pi: Removal:
First, stop the Homebridge service and remove the current version of Node.js along with npm (Node Package Manager) and any associated files:
This will clean up the system by removing Node.js, npm, and related files from global system directories. Removing Dependencies:
If you have installed other Node.js packages, you can remove them with:
sudo apt-get autoremove
This helps in cleaning up unused packages that were automatically installed to satisfy dependencies for other packages. Reinstalling Node.js:
Now, you can install the desired version of Node.js using the Homebridge service command:
sudo hb-service update-node --version 18.18.0
This command uses the Homebridge service’s utility to install the specified version of Node.js. Verification:
After installation, check that Node.js is correctly installed:
node -v
The command should return the version of Node.js that you have just installed. Restarting Homebridge Service:
Once Node.js is installed, restart the Homebridge service:
sudo hb-service start
Service Check:
Verify that Homebridge is running properly:
sudo hb-service status
If you encounter any issues during the process, they should be addressed with detailed error messages. Remember that when updating Node.js, you may also need to update dependencies of your Node-based applications to ensure compatibility with the new version. Make sure that your Homebridge plugins are compatible with the new version of Node.js.
That did it for me, thanks for posting!
Would have been helpful around 2130 last night when my journey started. 😂
Same. I spent a few hours trying to update nodejs and get homebridge to work. I never did. I finally did a new install and then restored my homebridge settings from a backup and got back to where I was before I tried to update. I’m just going to let it ride for a while because I can’t go through that again.
I ended up taking a copy of my config.json file, completely uninstalling Homebridge then reinstalling. Then copied over the config file and reinstalled my plugins and everything started working again!
@NorthernMan54 Thanks for such a great job and for taking the suggestions. I have a few more:
Risked it (I like to live dangerously) and it went smoothly without hitch.
pi@homebridge:/var/lib/homebridge $ hb-service update-node ℹ Updating Node.js from v18.18.2 to v20.9.0… ℹ Target: /opt/homebridge ✔ Download complete. ✔ Cleaned up npm at at /opt/homebridge/lib/node_modules/npm ✔ Installed Node.js v20.9.0 ℹ Rebuilding for Node.js v20.9.0… rebuilt dependencies successfully ✔ Rebuilt homebridge-config-ui-x for Node.js v20.9.0. rebuilt dependencies successfully ✔ Rebuilt plugins in /opt/homebridge/lib/node_modules for Node.js v20.9.0. ⚠ Please restart Homebridge for the changes to take effect. pi@homebridge:/var/lib/homebridge $
Doesn’t work.
pi@homebridge:~ $ sudo apt-get reinstall homebridge Reading package lists… Done Building dependency tree
Reading state information… Done E: Unable to locate package homebridge pi@homebridge:~ $
Are they 3 long commands. Or are they in seperate steps? (I’m not a guru with this and only use it for Homebridge for Apple integration).
@murtazabasrai Yes. I had to add everything to Apple Home again, set scenes and automations again. I fought it for 6 hours.
This worked for me. Revealed that I needed to update npm. Thanks!