Unable to install NodeJS 14.x from NodeJS repo, Ubuntu's version 18.x is always installed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nodejs (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
It started after upgrade 22.04 => 22.10
Suppose no NodeJS version is installed (and no external NodeJS repo is saved in /etc/apt)
-------------------
$ node --version
Command 'node' not found, but can be installed with:
sudo apt install nodejs
------------------
Install NodeJS 14.x: https:/
You can see that NodeJS 18.x instead of NodeJS 14.x will be installed:
-------
$ curl -fsSL https:/
sudo apt-get install -y nodejs
## Installing the NodeSource Node.js 14.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 http://
Hit:2 http://
Hit:3 http://
Hit:4 http://
Hit:5 https:/
Hit:6 https:/
Hit:7 https:/
Hit:8 https:/
Reading package lists... Done
## Confirming "kinetic" is supported...
+ curl -sLf -o /dev/null 'https:/
## Adding the NodeSource signing key to your keyring...
+ curl -s https:/
gpg: WARNING: unsafe ownership on homedir '/home/
## Creating apt sources list file for the NodeSource Node.js 14.x repo...
+ echo 'deb [signed-
+ echo 'deb-src [signed-
## Running `apt-get update` for you...
+ apt-get update
Hit:1 http://
Hit:2 http://
Hit:3 http://
Hit:4 https:/
Hit:5 https:/
Hit:6 https:/
Hit:7 https:/
Hit:8 http://
Get:9 https:/
Get:10 https:/
Fetched 5,358 B in 1s (3,683 B/s)
Reading package lists... Done
## Run `sudo apt-get install -y nodejs` to install Node.js 14.x and npm
## You may also need development tools to build native addons:
sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
curl -sL https:/
echo "deb [signed-
sudo apt-get update && sudo apt-get install yarn
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
npm
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
Need to get 0 B/283 kB of archives.
After this operation, 1,937 kB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 236355 files and directories currently installed.)
Preparing to unpack .../nodejs_
Unpacking nodejs (18.7.0+
Setting up nodejs (18.7.0+
update-
Processing triggers for man-db (2.10.2-2) ...
-------
$ node --version
v18.7.0
Workaround - use the "n" tool for switching to another NodeJS version:
$ sudo npm install -g n
$ sudo n 14