2

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...

@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.

0

1 Answer 1

2

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.