So I pasted all the above into copilot which responded:
We're doomed.
And it worked.The error message you’re seeing indicates that the version of Node.js being used by the npm command in the systemd service is not compatible with the version of npm itself.
Given that the npm command is associated with the binary located at /home/pi/.nvm/versions/node/v20.10.0/bin/npm, it seems that there might be a mismatch between the version of Node.js that your user environment is using and the version that the systemd service is using.
One way to resolve this could be to specify the PATH in the systemd service file, so it includes the directory where the correct version of Node.js is installed. You can do this by adding the following line in the [Service] section of your systemd service file:
Environment="PATH=/home/pi/.nvm/versions/node/v20.10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
This line sets the PATH environment variable for the systemd service, and it should now be able to locate the correct version of Node.js.
After making this change, remember to reload the systemd daemon and restart your service:
sudo systemctl daemon-reload
sudo systemctl restart zigbee2mqtt.service
I hope this helps! Let me know if you have any other questions. Image may be NSFW.
Clik here to view.
We're doomed.
Statistics: Posted by AdrianM — Tue Jan 16, 2024 5:25 pm