I am trying to install node.js version10 on my ubuntu 18.04 but it is always installing version 8.10. I have tried different links. I have tried the following commands:
$ sudo curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
Installing the NodeSource Node.js 10.x repo...
Populating apt-get cache...
- apt-get update Hit:1 http://linux.teamviewer.com/deb stable InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 https://dl.yarnpkg.com/debian stable InRelease
Hit:4 https://download.docker.com/linux/ubuntu bionic InRelease
Hit:5 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:7 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Hit:8 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic InRelease
Get:9 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Ign:10 http://download.virtualbox.org/virtualbox/debian 18.04 InRelease Hit:11 http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu bionic InRelease Hit:12 http://ppa.launchpad.net/wireshark-dev/stable/ubuntu bionic InRelease Err:13 http://download.virtualbox.org/virtualbox/debian 18.04 Release 404 Not Found [IP: 23.40.180.94 80] Reading package lists... Done E: The repository 'http://download.virtualbox.org/virtualbox/debian 18.04 Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. Error executing command, exiting
@lc2530hz:~$ sudo apt install nodejs
Reading package lists... Done Building dependency tree Reading state information... Done nodejs is already the newest version (8.10.0~dfsg-2ubuntu0.4). The following packages were automatically installed and are no longer required: gyp libjs-async libjs-inherits libjs-node-uuid libssl1.0-dev libuv1-dev libwireshark11 libwiretap8 libwscodecs2 libwsutil9 Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 259 not upgraded.
But I am always getting version 8.10:
lc2530hz:~$ node -v
v8.10.0 @lc2530hz:~$
Somebody please guide. Zulfi.
I am using
nvm
to switch between nodejs versions.https://github.com/nvm-sh/nvm
Install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
restart terminal
Install node 10.x:
nvm install 10
Switch to node 10.x:
nvm use 10
Check node version:
node -v