Page 1 of 1

Generally accepted standard process to install Node.js and NPM

Posted: Sat May 18, 2019 3:33 pm
by afgoody
Hello,
I'm rebuilding my RPi 3 and can't seem to get Node.js and NPM installed properly. As I research, I find many different processes, command syntax, and recommendations (e.g. using Node Version Manager, which folder to extract the files into, etc.).

I followed these instructions (https://www.battlehillmedia.com/install ... erry-pi-3/) to attempt to completely remove all Node.js and NPM. It seemed to work (see below).

Is there a generally accepted standard process to install Node.js and NPM?

[email protected]:~ $ node -v
v8.11.1
[email protected]:~ $ npm -v
-bash: npm: command not found
[email protected]:~ $ sudo apt remove nodered -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libc-ares2 libhttp-parser2.8 libuv1 nodejs nodejs-doc
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
nodered
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 60.1 MB disk space will be freed.
(Reading database ... 132983 files and directories currently installed.)
Removing nodered (0.20.5) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for gnome-menus (3.13.3-9) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
[email protected]:~ $ sudo apt remove node nodejs nodejs-legacy -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'node' is not installed, so not removed
Package 'nodejs-legacy' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libc-ares2 libhttp-parser2.8 libuv1 nodejs-doc
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
nodejs
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 15.8 MB disk space will be freed.
(Reading database ... 126220 files and directories currently installed.)
Removing nodejs (8.11.1~dfsg-2~bpo9+1) ...
Processing triggers for man-db (2.7.6.1-2) ...
[email protected]:~ $ sudo apt remove npm -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'npm' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libc-ares2 libhttp-parser2.8 libuv1 nodejs-doc
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[email protected]:~ $ node -v
-bash: /usr/bin/node: No such file or directory
[email protected]:~ $ npm -v
-bash: npm: command not found
[email protected]:~ $ sudo apt remove --purge node
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'node' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libc-ares2 libhttp-parser2.8 libuv1 nodejs-doc
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[email protected]:~ $