Score:1

node -v: Command 'node' not found (but node is installed)

ar flag

I am facing a strange issue while using nodejs. When i try to run node -v i get this:

Command 'node' not found, but can be installed with:

sudo apt install nodejs

And when i try to run npm -v i get this:

Command 'npm' not found, but can be installed with:

sudo apt install npm

But when i try to install node using nvm like this nvm install v16.13.1 i get this:

v16.13.1 is already installed.
Now using node v16.13.1 (npm v8.1.2)

Now node -v and npm -v also work. This is happening everytime i restart my system. It is really annoying to run nvm install v16.13.1 everytime is start my PC. any idea why this is happening?

Vthechamp avatar
jp flag
maybe you are missing some config files for nvm, try re-installing nvm?
Manoj avatar
ar flag
@Vthechamp re-installing nvm did not work. I have tried installing node version 12.12.0 it works fine. But when i switch my current node version to 16.13.1 and restart my system, the node version switched back to 12.12.0
Vthechamp avatar
jp flag
did you install node from `apt`? if so, try removing the `apt` node and installing from nvm?
Manoj avatar
ar flag
@Vthechamp i used to have node version installed from apt. but i have uninstalled it before installing node with nvm.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.