link plugin & file ownership; best practices

I've developed a plugin which I linked using "npm link". The plugin than pops up in Plugin Config menu. However I noticed subsequently I can't install any plugins from the Appstore anymore due to permission issues: with "ls -ld /home/user/.signalk/node_modules" i checked ownership. Once I chown the permissions to the current user I'm able to install apps from Appstore gain but my Plugin's Config dissapears from the list again. Also I tried and configured npm to use the directories for global installations to avoid the need to use sudo and ensure all files are owned by the user. However still same issue. Anybody know the right way to prevent this from happening?
3 Replies
Teppo Kurki
Teppo Kurki7mo ago
the way I work with plugins is that I have server cloned from github and built. then I use npm link in the server directory, not in .signalk/ i can't recall running into any ownership issues with this setup downside is that any npm install that I run in the server directory will delete the link and it needs to be linked again plugin config disappearing means that the server no longer sees your plugin, neither in server's own node_modules or in .signalk/node_modules
Koenraad de Haas
Koenraad de HaasOP7mo ago
thanks for the quick answer! I've used npm link in the Signal K server configuration directory (like described in documentation) What do you mean by the server directory (vs .signalk )?
Teppo Kurki
Teppo Kurki7mo ago
Server cloned from github

Did you find this page helpful?