Hi Steven, I experienced an issue with my globally installed npm packages getting wiped. Here are the steps to reproduce on a Pi Zero:
- Install Node using an install script such as
install-node-v.last.sh
- Install npm packages globally such as
pm2``: npm install -g pm2`
- Install a different version of Node using a script such as
install-node-v.lts.sh
After these steps, the pm2 command cannot be invoked and is no longer available as well as any other NPM packages that I installed globally. I see in the install scripts that /opt/nodejs gets wiped every time the install script runs and thus the contents of /opt/nodejs/lib/node_modules containing pm2 gets wiped too.
Can you update the install scripts to preserve the contents of /opt/nodejs/lib/node_modules (with the possible exception of the npm directory which will be regenerated) before doing the installation?
Thanks!
Hi Steven, I experienced an issue with my globally installed npm packages getting wiped. Here are the steps to reproduce on a Pi Zero:
install-node-v.last.shpm2``:npm install -g pm2`install-node-v.lts.shAfter these steps, the
pm2command cannot be invoked and is no longer available as well as any other NPM packages that I installed globally. I see in the install scripts that/opt/nodejsgets wiped every time the install script runs and thus the contents of/opt/nodejs/lib/node_modulescontainingpm2gets wiped too.Can you update the install scripts to preserve the contents of
/opt/nodejs/lib/node_modules(with the possible exception of thenpmdirectory which will be regenerated) before doing the installation?Thanks!