-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add further documentation to npm link #69
Comments
@LeLunZ thanks for flagging this! I was having similar problems. |
Further to this issue, shouldn't one use "hb-service link" rather than npm link? |
i think i'm having issues related to this. in the past, i set up a homebridge server which included an npm install and i could clone a repo and do |
so it looks like maybe i have to use the hb-shell to install the dependencies. this still didn't fix the issue i had with needing to run as root though in order for it to have permissions to follow the symlink |
if i moved the directory to the /home/homebridge/ directory and set the permissions and then did the |
On a raspberry pi running the homebridge OS, I use the following to link the custom custom plugin. Download & build custom plugin:
Link NPM Package to Homebridge:
|
and so you didn't have to mess with permissions on /home/opensauna/OpenSauna? I did basically the same thing, but homebridge (running under the homebridge user) was throwing EACCES permissions errors when it tried to load the plugin at service start. moving the repo under /home/homebridge and setting the owner as homebridge:homebridge solve this, but it means i'll have to either make my user a member of the homebridge group, or i'll have to do my plugin development as root and make sure to change the ownership on any new files i create. |
@brianhackel you need to do this with the homebridge user account/permissions or from the terminal provided in the web-ui. There I don’t have any permission errors. |
I used the default pi:raspberry login on the Homebridge Pi image (docs), no settings or permissions were changed. I did create symlinks for npm and node to make my life easier: Add symlinks:
|
@luis-godinez, good call on the symlinks. Thanks all! |
Some additional comments also for for others wo have the same issues. The symbolic links to use nodejs and npm from the homebridge installation is a very good idea and worked for me;
The generation of the symbolic link with npm link did not work out for me because it generates a relative link instead i used
Also the dependency to the package has to be added into the package.json of homebridge e.g. And finally the config to the config.json |
And also note you need to turn off this flag --strict-plugin-resolution which is documented on forums but when changing the startup script to remove it's still on. You have to do it from the UI where it's called "Homebridge 'Insecure' Mode" I think the documentation should be improved and would gladly help if I can find a clean way to actually get everything to work without a load of bash gymnastics :) The above is helpful, didn't think of doing the linking of node and npm... |
From the README.md it seems one should run
npm link
while he is in the project folder. (as its directly after building the project and its never specified to change directory)But from the experience I just had, you need to run it from the homebridge path (
/var/lib/homebridge
) like thatnpm link /path/to/project
The text was updated successfully, but these errors were encountered: