Mitchell van Zuylen
Mitchell van Zuylen

Reputation: 4115

Node not installed after installation

I installed nodejs using sudo apt-get, which appeared to continue perfectly. If I now run sudo apt-get install nodejs it'll tell me:

Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.

Yet, when I try to test node using node -v or node hello.js there is no reply. No error nothing.

How can I get it running?

Upvotes: 0

Views: 346

Answers (1)

Cuong Vu
Cuong Vu

Reputation: 3723

Remove current nodejs package

sudo apt-get purge nodejs

and run the following command (node version 10)

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

then check again

node -v

Upvotes: 1

Related Questions