0

I am having trouble installing&running nodejs on my ubuntu 18 pc.

I run following commands step by step:

sudo apt update
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt -y install nodejs

And later checked the version number:

node -v
v8.10.0

Later I removed nodejs and i tried to install nodejs 12, 13 and 11, every time it is installing v8.10.0.

Can anyone please help me in this case?

2
  • Have you tried to download it and setup? nodejs.org
    – Amr Eraky
    Jul 16, 2020 at 9:20
  • My guess would be that curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - fails. We probably need the output of that.
    – VLAZ
    Jul 16, 2020 at 9:29

2 Answers 2

1

My theory is that node 8 is installed no matter what and that it's in your PATH with a higher priority. Try uninstalling all versions of node and run node -v to verify that. If that's the case, I suggest you try to find a way to uninstall that version of node before reinstalling the version you want.

Also by typing which node you can get the path of the current executable that is being called when you call the node command. It may be a symlink in which case ls -l of the returned path would show you to path pointed by it.

Anyway, I suggest using nvm (Node Version Manager). Documentation at https://nvm.sh

0

Guess it's nvm, run

nvm ls to list all the node versions

nvm use <node version you want to use>

nvm current to check the node version in use

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.