I have just run the
bash <(curl... script to install node-red on a pi-zero running raspbian lite. It is all working ok but I am confused by something.
The first time round I got stuck in the
node-Red not fully installed loop wanting to run re-run the script so I removed
usr/bin/node, checked that
node -v showed command not found and re-ran the script, and all seems to be working ok. However I am confused about how nodejs has been installed. I see
$ node -v v10.15.3 $ npm -v 6.9.0 $ which node /usr/bin/node $ which npm /usr/bin/npm
which looks fine, but I also see
$ apt-cache policy nodejs nodejs: Installed: (none) Candidate: 8.11.1~dfsg-2~bpo9+1 Version table: 8.11.1~dfsg-2~bpo9+1 500 500 http://archive.raspberrypi.org/debian stretch/main armhf Packages 4.8.2~dfsg-1 500 500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
and there is no nodesource repo in
/etc/apt/sources.list.d so I don't understand how node has been installed.
During the script it showed
Stop Node-RED ✔ Remove old version of Node-RED ✔ Remove old version of Node.js ✔ Install Node.js for Armv6 ✔ Node v10.15.3 Npm 6.9.0 Clean npm cache ✔ Install Node-RED core ✔ 0.19.6 Move global nodes to local - Install extra Pi nodes - Npm rebuild existing nodes - Add shortcut commands ✔ Update systemd script ✔
The relevant section of the install log has
Package 'nodejs-legacy' is not installed, so not removed Package 'npm' is not installed, so not removed Package 'nodejs' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. dpkg: warning: ignoring request to remove nodejs which isn't installed dpkg: warning: ignoring request to remove node which isn't installed Reading package lists... Building dependency tree... Reading state information... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. /usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js /usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js + email@example.com added 54 packages from 9 contributors, removed 15 packages and updated 47 packages in 372.011s
So the question is, how has nodejs been installed?