You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preconditions: nodejs has been installed by means other than the Node-RED installer and its bin files linked into /usr/local/bin.
If you run the install script for the Raspberry Pi without any of the options to install a particular version of nodejs, that is, direct it to use an existing installation of nodejs already on the system, the install script will remove the node and npm commands from the system if they are installed in /usr/local/bin, thus damaging the existing nodejs installation. This also then prevents Node-RED from starting successfully when node-red-start is attempted, because it then cannot find node or npm:
The deletion of the files occurs at line 338:
sudo rm -rf /usr/local/lib/node_modules/node-red* /usr/local/lib/node_modules/npm /usr/local/bin/node-red* /usr/local/bin/node /usr/local/bin/npm 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null
Expected Behavior
The script should not remove executables that it didn't previously install. It seems to assume that any node and npm files installed in /usr/local/bin are its own from a previous install, but this seems a bit broad.
Steps To Reproduce
Install any version of nodejs using their recommended instructions. After that, link the installed executables into /usr/local/bin. Some systems may do this with their own package installers.
Then run the RPi Node-RED install script per the instructions as shown (with no option to install a particular version of node).
Example flow
N/A
Environment
Node-RED version: 2.1.4
Node.js version: any
npm version: any
Platform/OS: *nix
Browser: N/A
The text was updated successfully, but these errors were encountered:
Currently the script only tries to uninstall them if they are not a suitable version (so currently 12 or greater). What should it do if it find a version in usr/local/bin ? Just abort and tell the user to uninstall it themselves ? If we don't uninstall it we cannot proceed as the usr/local/bin version will take precedence and then Node-RED will not be in a runnable state.
Maybe you're looking at a different version of the script than I am, but the line I referenced is outside the test for old version (which appears to be a block beginning at line 271 and ending at 300, well before the line that removes the files). In fact, the only thing restricting the execution of line 338 (the removal from /usr/local/bin) is the case/test at 209 where the user indicates that it's OK to proceed.
And in any case, I was using nodejs 16.13 during the run, which is supported, so the low-version branch would not apply.
Current Behavior
Preconditions: nodejs has been installed by means other than the Node-RED installer and its
bin
files linked into/usr/local/bin
.If you run the install script for the Raspberry Pi without any of the options to install a particular version of nodejs, that is, direct it to use an existing installation of nodejs already on the system, the install script will remove the
node
andnpm
commands from the system if they are installed in/usr/local/bin
, thus damaging the existing nodejs installation. This also then prevents Node-RED from starting successfully whennode-red-start
is attempted, because it then cannot findnode
ornpm
:The deletion of the files occurs at line 338:
Expected Behavior
The script should not remove executables that it didn't previously install. It seems to assume that any
node
andnpm
files installed in/usr/local/bin
are its own from a previous install, but this seems a bit broad.Steps To Reproduce
Install any version of nodejs using their recommended instructions. After that, link the installed executables into
/usr/local/bin
. Some systems may do this with their own package installers.Then run the RPi Node-RED install script per the instructions as shown (with no option to install a particular version of node).
Example flow
N/A
Environment
The text was updated successfully, but these errors were encountered: