7

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!

mikeym
  • 5,705
  • 8
  • 42
  • 62

5 Answers5

11
nvm list

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

Siraj Alam
  • 9,217
  • 9
  • 53
  • 65
Shelton.C
  • 111
  • 1
  • 4
4

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.

Prajval Singh
  • 501
  • 3
  • 9
2

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.

Fedor
  • 17,146
  • 13
  • 40
  • 131
Jon Dawson
  • 21
  • 3
0

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?

ChrisM
  • 1,565
  • 14
  • 24
-1

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.