Open tkurki opened 1 month ago
npm config get maxsockets
default is 15. If this is tuned, would it make any difference e.g. npm config set maxsockets 5
or even smaller amount?
Also npm i --max-old-space-size=250
might be viable solution to limit memory usage.
I tried to reinstall all my plugins on my PRi3 by removing .signalk/node_modules and simply running
npm install
in .signalk.This turned out to be problematic in two ways:
pstree
showed a number ofnpm install
processes and I think i saw node-pre-gyp in top also.Doing the same operation manually, one by one (under
docker run -it --rm -v /home/pi/signalk-settings:/home/node/.signalk --entrypoint /bin/sh signalk/signalk-server:master
) succeeded without breaking a sweat.To me this suggests that just given a package.json
npm install
goes all out, with parallel operations, which may be just too resource intensive for some typical platforms that Signal K is used on.I can think of two solutions here:
sk-reinstall-plugins
script that renames node_modules and package.json and then loops over the plugins there, installing them one by one--reinstall-plugins
that does the same thing as the script. this would support also Windows platform