Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fresh install of NVM won't work

Tags:

node.js

nvm

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?

like image 649
David Avatar asked Aug 15 '16 22:08

David


People also ask

Why Windows NVM not working?

During nvm installation, make sure the selected path must NOT exist. Suppose if you selected “C:\Program Files\nodejs” in installation then nodejs must NOT exist in “Program Files” folder. It will be created by setup. If there is already folder then delete it, run “nvm use” command and test it again.


2 Answers

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.

like image 71
donghanji Avatar answered Oct 22 '22 09:10

donghanji


  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
    
like image 18
Ashwin Avatar answered Oct 22 '22 08:10

Ashwin