40

Went to use NVM today, and I got this error.

This is not the package you are looking for: please go to http://nvm.sh

So I went there, and installed the new version. Installation went through, but I still get the same error when I try to run it. I deleted the .nvm folder, and tried reinstalling. Nothing is working.

Is there a way to fix this error, or another way to downgrade my version of node?

Liam
  • 27,717
  • 28
  • 128
  • 190
David
  • 2,094
  • 3
  • 30
  • 47

5 Answers5

33

see http://nvm.sh

https://github.com/nvm-sh/nvm/blob/master/README.md#install--update-script and run the script that starts with wget:

It should look like this:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

But go copy the script from the link, cause the version might change. After you do this, close and reopen your terminal.

Sangram Nandkhile
  • 17,634
  • 19
  • 82
  • 116
donghanji
  • 370
  • 4
  • 4
  • 11
    Important part is closing and reopening the terminal – David Jul 25 '17 at 21:01
  • 1
    @donghanji, You are almost correct in that wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash works correctly. But, when I do this step, env http_proxy=http://www-proxy.87654 && nvm ls -remote I get N/A. What should I do next? How do I close and reopen the terminal? Thank you. – Frank Feb 03 '18 at 18:39
  • 2
    You don't necessarily have to reload the terminal _per se_... you only have to reload the shell. So a `cd && source .bashrc` after installing the package for example, should sufice... – iamdanchiv Feb 22 '19 at 10:56
  • 2
    how do you get this without internet connection? – magor May 13 '19 at 10:25
  • Problem solved! The key is to reopen your terminal. Thank you! – ShinChven May 22 '20 at 15:44
  • Doesn't work on fish – arturasmckwcz Nov 18 '21 at 19:28
25
  1. After a long troubleshooting, I got it working on mac OS:

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
    
  2. Add the following lines in your .zshrc or .bash_profile file:

    export NVM_HOME=/Users/your-user/.nvm
    
    export PATH=${PATH}:${NVM_HOME}
    
    source ${NVM_HOME}/nvm.sh
    

Note: Replace your-user in the above command with your home directory name.

  1. Restart the terminal.

  2. Verify:

    nvm --version
    
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Ashwin
  • 7,277
  • 1
  • 48
  • 70
  • 4 years later, this is the now the best answer. wget method still works, but the rc file update is required. Especially if your OSX install is fresh, as neither .zshrc nor .bash_profile are there until you make them. – David Sep 01 '20 at 08:37
  • Today, years later, the installer on Max OS adds commands to `.bashrc` to export and load `nvm`. When using a different shell to BASH then simply copy these lines to the shell's "configuration" file. In my case I updated `.zprofile` used by ZSH. – OSGI Java Sep 28 '21 at 15:49
12

tl;dr

Don't install nvm using npm and if you have tried this, uninstall that version using npm


I got this error because I'd inadvertently tried to install nvm from npm. The solution came from here:

You also need to npm uninstall -g nvm as well.

You will then need to install it using one of the other methods in this question. This presumably updates the path to the correct version installed manually.

Liam
  • 27,717
  • 28
  • 128
  • 190
0

Faced similar sort of issue and as I had some system restrictions, I followed this link: https://github.com/coreybutler/nvm-windows

  • Download the nvm setup zip file from releases.
  • Follow the steps mentioned in the above link to uninstall node and npm.
  • Do nvm installation now and you would see that nvm will be recognized.
  • Now you can choose to install the node version that you need directly by using "nvm install" command or you will have to place the node installables inside your nvm folder with their version name like v6.9.1 or v.10.15.1. By using "nvm use" command you should be able to switch in between the node versions.

There is another issue which I faced and thought of sharing it here:

  • In case your Program Files is referring to say node v 10.15.1 installation, and you use "nvm use 6.17.1 64", if you will check the node version again using node -v it will still show v10.15.1. To overcome this scenario just rename the nodejs file in Program Files and then give try "nvm use" command again. Now you will see that your node version is referring to the correct version which nvm was asked to use.
Manit
  • 1,087
  • 11
  • 17
0

since you have installed nvm-windows, i think it's caused by you still have other version on the computer, try run "where nvm" from command line, make sure nvm nvm.exe is at the first line.

  • Please don't add "thank you" as an answer. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation), you will be able to [vote up questions and answers](https://stackoverflow.com/help/privileges/vote-up) that you found helpful. - [From Review](/review/late-answers/34426144) – Wahlstrommm May 23 '23 at 13:17