Homebridge-config-ui-x: How to switch to hb-service?

Created on 11 Jan 2020  路  5Comments  路  Source: oznu/homebridge-config-ui-x

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 -

  • Node.js Version: 11.15
  • NPM Version: 6.13
  • Homebridge Version: latest
  • Homebridge Config UI X Version: latest
  • Operating System: Raspbian Buster
  • Process Supervisor: Systemd
question

Most helpful comment

Actually, I wouldn't do that just yet. Let me test what's going to happen.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamieshaw picture jamieshaw  路  5Comments

johannrichard picture johannrichard  路  4Comments

Partizan7676 picture Partizan7676  路  4Comments

eximiusvir picture eximiusvir  路  5Comments

mbierman picture mbierman  路  5Comments