Why is my node version in my ubuntu terminal v10 even though I downloaded the latest stable version through browser?

Viewed 1706
$ node -v

v10.19.0

$ npm -v

: not foundram Files/nodejs/npm: 3:
: not foundram Files/nodejs/npm: 5: /mnt/c/Program Files/nodejs/npm: 6: Syntax error: word unexpected (expecting "in")

2 Answers

I would recommend installing Node with nvm.

download NVM using following command on terminal
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash

verify nvm is installed using nvm --version

install the required node version using nvm install 12.14.1 and then use the installed version using nvm use 12.14.1

Try running sudo apt-get update in your Ubuntu terminal.

Then run sudo apt-get upgrade and look to see if any packages were modified.

If that doesn't work, try installing node.js directly from the command line using sudo apt-get install nodejs. Then check your version again with node -v and see if there are any changes.

Here's a reference

Additionally, here is an article explaining in detail how to add both node and npm directly from the command line

I prefer whenever possible to use the command line for installs, especially on Windows subsystem for Linux where not every package is compatible just yet. That should get you somewhere in this vicinity. enter image description here

Related