mikeym
mikeym

Reputation: 6311

nvm ls does not list specific installed version numbers

I recently ran an npm update that broke my Vue app. As a result, I am trying to revert my server to the previous version of Node/npm that it was using.

However, when I run nvm ls I get the following output in the terminal.

->       system
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)

It doesn't give a list of installed versions to try. If anyone can tell me how to get around this I'd much appreciate it.

The question has been asked before but has not been adequately answered.

I am using Ubuntu 21.04.

Thanks!

Upvotes: 28

Views: 125646

Answers (9)

chanchal
chanchal

Reputation: 594

To list all the available node versions

`nvm list available`

To list all the installed version of node on machine

`nvm list installed`

Upvotes: -1

Harish Lalwani
Harish Lalwani

Reputation: 774

downgrading to any available version worked for me. I have Linux Mint 19.2 Cinnamon system.

   nvm ls-remote
   nvm use  v16.15.1

Upvotes: 3

Narendra Kuruva
Narendra Kuruva

Reputation: 69

nvm list

This worked fine for me on my Ubuntu OS system. It list's all the installed versions of node in your system

Upvotes: 7

Vipul
Vipul

Reputation: 21

nvm list

here the output:

         v6.9.0
         v8.2.1
        v8.17.0
->     v14.17.1
       v18.14.0
default -> v18.14.0

Upvotes: 2

castelinos
castelinos

Reputation: 427

nvm list

This command worked fine for me. It will list all the installed versions of node under nvm

Upvotes: 40

Prajval Singh
Prajval Singh

Reputation: 1111

This happens when you have installed node but not installed using nvm, you can install the versions again, by like

nvm install 12.14 where 12.14 is that particular version you wanna use.

and use it by nvm use 12.14.

I read somewhere that you can actually have those versions being managed by nvm itself, but I need to find it again, will update my answer when I find it.

Upvotes: 8

Jon Dawson
Jon Dawson

Reputation: 21

After using both wget and curl to install the script for nvm I get the same result:

  • nvm ls-remote shows "N/A".
  • nvm list-remote shows "N/A".
  • nvm current shows system.

I've reinstalled nvm after deleting the folder ~/.nvm.

Also, I've changed the nvm.sh file to include -k after curl in "nvm_download" function.

These actions were guided by the following thread: nvm ls-remote command results in "N/A"

Any other routes of troubleshooting would be appreciated.

Upvotes: 2

ChrisM
ChrisM

Reputation: 1672

That is the output that you see if you don't have any NVM versions installed but you have a system version installed.

Although it doesn't give the version of the system package but you can see what version you are using at any given time by using the command node --version

More precisely to query the system version; You should be able to see that using the command dpkg -s nodejs. (assuming you have a standard Ubuntu installation using apt and dpkg and have the standard nodejs package installed).

However if you're using nvm you should simply be able to install the version you want by running e.g. nvm install 16.15.1. The fact there is a system version shouldn't cause problems if nvm is working.

For what is perhaps the real question of why you have no NVM versions installed, or what version of node you are trying to restore; unfortunately there's no way of telling from the information provided.

PS: The command nvm ls-remote will give you a live list of all node versions available to nvm. For lot's more information about this you can refer to this stackoverflow question: How do I update Node.js?

Upvotes: 1

Wallace Ferreira
Wallace Ferreira

Reputation: 59

It seems a system version of node is installed. If brew is installed, you can symply do: brew uninstall node. You can also run this commands as alternative:

 $ sudo rm /usr/local/bin/node

Otherwise, if none of there works, uninstall nvm, remove local node and install nvm again.

Upvotes: -1

Related Questions