Difference between revisions of "Getting up-to-date NodeJS & NPM"
Line 1: | Line 1: | ||
<p>'''nodejs''' & '''npm''' versions are problematic.</p><p>For some reason, the versions available in all of the repositories tend to be out of date AND all attempts to update them fail in weird & wonderful ways.</p> | |||
Currently, the most up to date version of '''nodejs''' is 18.14.2 LTS | Currently, the most up to date version of '''nodejs''' is 18.14.2 LTS | ||
(You can verify the current version at [https://nodejs.org/en/ the official site]) | |||
= A WORKING Set of install instructions = | |||
To get current version(s) on a machine WITHOUT nodejs installed yet: | To get current version(s) on a machine WITHOUT nodejs installed yet: | ||
* <code>curl -sL https://deb.nodesource.com/setup_18.x {{!}} sudo -E bash -</code> | * <code>curl -sL https://deb.nodesource.com/setup_18.x {{!}} sudo -E bash -</code> |
Revision as of 16:00, 7 March 2023
nodejs & npm versions are problematic.
For some reason, the versions available in all of the repositories tend to be out of date AND all attempts to update them fail in weird & wonderful ways.
Currently, the most up to date version of nodejs is 18.14.2 LTS
(You can verify the current version at the official site)
A WORKING Set of install instructions
To get current version(s) on a machine WITHOUT nodejs installed yet:
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs
sudo npm install npm@latest -g
& verify that you have the up-to-date versions:
node -v
- You should see: v18.14.2
npm -v
- You should see: 9.6.0
If the machine already has an outdated version installed
All instructions for updating seem to fail...
But!
Removing the installed version first is an option:
sudo apt remove npm
sudo apt remove nodejs
Then go back & start the above installation.
The Old Instructions (Left here for reference...)
NOTE: The Ubunto repositories serve up an outdated version of Node.js. (v10.19.0)
Node-Red 2 requires v12... (and apparently, soon to require newer than that...)
To determine what version you actually have once it's installed:
nodejs -v
Anywho...
sudo apt install nodejs -y
sudo apt-get install -y build-essential
sudo apt install npm -y
-
sudo npm install npm@latest -g
- NO! DO NOT UPDATE NPM!
- (Doesn't actually seem to change anything on Debian... Updates to 8.3.0 on Ubuntu.)