Can鈥檛 use sudo hb-service install --user homebridge getting hb-service: command not found
Path for installing modules globally home/pi/.npm-global
I used this manual for setting up this folder because I was getting permission errors with some plugins
https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
Node.js was installed with this command
curl -sL https://deb.nodesource.com/setup_11.x | sudo bash -
Changing the global modules path is the problem here.
I think this might work for you, setting the user to pi not homebridge is important in this case.
sudo -E hb-service install --user pi
Actually, I wouldn't do that just yet. Let me test what's going to happen.
Path for installing modules globally home/pi/.npm-global
So this is the problem here. The hb-service command is not available in the root (sudo) user's PATH. I would not recommend attempting to run hb-service in a non-standard environment such as this.
If you have a working setup now, I would recommend just leaving it.
If you want to move to hb-service then you should undo the changes you made to the global modules location, and re-install Homebridge and Homebridge Config UI X, then you should be able to safely run the hb-service install command.
For testing purpose I took a spare SD card, wrote the Raspbian Buster image, followed instructions from this page and still getting hb-service: command not found
Thank for for testing @Olepir, I forgot to add the --unsafe-perm flag to the install command in the wiki when copying the instructions from the Windows 10 guide.
I've fixed this up now. You can probably run these commands to get you back to where you need to be:
# remove
sudo npm uninstall -g homebridge homebridge-config-ui-x
# reinstall
sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x
After doing that the hb-service command should be available.
Most helpful comment
Actually, I wouldn't do that just yet. Let me test what's going to happen.