All SK Plugins installs fail
more info here: https://forum.openmarine.net/showthread.php?tid=6355&pid=34507#pid34507
But basically SK is running along side Maretron Connect on a 4B Pi. Node is non standard install by default and I can't change that. I am getting this from the SK Log - stderr: Error: spawn npm ENOENT. $PATH = /home/[user name]/.config/nvm/versions/node/v22.17.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Which includes the path to NPM/Node.
Any Ideas? I've tried symoblic link, but mayebe not set correctly? I added none_modules to /usr/local pointing otthe above path.
46 Replies
the problem is that npm is not in the path
just make sure npm is in the PATH of the user that runs the server
The error message probably means that starting npm is failing because it can not be found
Ah what scott said
[user name] seems really suspicious in the first path entry. Most probably you don’t have a user named
[user name]
missed that
nvm config is messed up I think
How should NVM be configured? The above [user name] should be "maretron", sorry.
The very first part of the path points to npm and node. Confussed now.
what very first part of the path? i think that is the problem - instead of
/home/[user name]/.config/nvm/versions/node/v22.17.0/bin
it should probably be /home/maretron/.config/nvm/versions/node/v22.17.0/bin
if you just start a shell can you run npm
? If yes what does which npm
say?Sorry, the path is what you say it should be. The [user name] was what I put in for the post.
This is ht elast line of launching a terminal and typing npm.
npm@10.9.2 /home/maretron/.config/nvm/versions/node/v22.17.0/lib/node_modules/npm
typing echo $PATH produces - /home/maretron/.config/nvm/versions/node/v22.17.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
since you edited your opening comment I assume that you just added the $PATH... part at the end and that is not part of the error message?
because it sounds like even if your shell has PATH set up correctly the signalk-server node process seems to be unable to find npm
can you check what user the node process running signalk server is running under? and with the process's id (pid) you can check what the valjue the PATH environment variable has with
sudo cat /proc/<pid>/environ
no pid displayed. Yes $PATH was after the original post. It's very hard to format post's here, sorry.

@Teppo Kurki and @Scott Bender Thank you for your help.
495, the first number on the line is the pid
no worries about formatting - and as you see it is easy to misunderstand
There is nothing listed for those PID's, 485 or 495

does the process still have the same pid or has it restarted and gotten a new pid?
Sorry, it changed. Didn't know it would do that for no reason.

So that shows that nvm is not in the PATH
Something to do with the way your starting the server, or the way the NVM environment is setup for that user.
(BYW, I use nvm also, without issue)
This is how SK is being started: [Service]
ExecStart=/home/maretron/.signalk/signalk-server
Restart=always
StandardOutput=syslog
StandardError=syslog
WorkingDirectory=/home/maretron/.signalk
User=maretron
Environment=EXTERNALPORT=3000
Environment=NODE_ENV=production
Environment=RUN_FROM_SYSTEMD=true
[Install]
WantedBy=multi-user.target
Ok, got it to work by adding a symbolic link to the /usr/bin dir for npm.
Thank you both for helping solve this!!!
Well, not thr right fix...
can you show the contents of /home/maretron/.signalk/signalk-server
That isn't where it is install. only /home/maretron/.signalk is there.
that's your startup script
ExecStart=/home/maretron/.signalk/signalk-server
Signalk-Server seems to be installed in: /home/maretron/.config/nvm/versions/node/v22.17.0/bin/signalk-server
I want to see the startup script
This is the contents of that script: #!/bin/sh
/home/maretron/.config/nvm/versions/node/v22.17.0/lib/node_modules/signalk-server/bin/signalk-server -c /home/maretron/.signalk $*
ok, that looks good
Under the server update it states: It can't be updated by the Admin ui.
Probably tied together then ...
are you runnig in docker?
Standard install on a 4B pi.
oh, yeah, it's because of where it is finding npm
instead of creating the symlink
The craziness is from the real purpose of the PI. It is a Maretron Connect that I was able to open up.
update the PATH to point to the nvm bin directory in
/home/maretron/.signalk/signalk-server
so:
oops
fixed
and remove that symlink you created
ohh
one more change!so edit that script?
yes
sorry the export threw me off.
Ok trying.
export
makes so the child process, signalk-server, will get the new PATHah thanks
Ok rebooted, but the plugins are now failing again.
and it says you can't update the server?
yes
that is so strange
yes it is
it's like the child process is not inheriting the PATH veriable
something with that OS
exactly, and why I used th elink. I had also tried putting htaat in the /etc/profile file. But that also failed.
I guess go back to the symlink, and you'll have to do updates manually
Yes, I think Maretron made it solely for them.
Ok, at least there is a working solution for ht emost part.
the*
Thank you very much for all of your help.
to update the server, just
npm install -g signalk-server
It is greatly appreciated.
ur welcome!
ok thanks.