'NVM Install Error: Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.

I JUST wiped and reformatted my entire Macbook Retina drive to start from scratch, installed homebrew, installed xcode and accepted terms and conditions, went to install nvm with curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash and got the following error:

=> nvm is already installed in /Users/dillon/.nvm, trying to update using git
=> => Compressing and cleaning up git repository

=> Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.
=> Create one of them and run this script again
   OR
=> Append the following lines to the correct file yourself:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

echo $PATH returns /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin if that's any help.

I tried opening an issue on github but haven't received a response

Any idea what I can do to get nvm and node properly running?



Solution 1:[1]

Didn't read this from the nvm install instructions. It fixed my problem.

Note: On OS X, if you get nvm: command not found after running the install script, one of the following might be the reason:-

your system may not have a [.bash_profile file] where the command is set up. Simply create one with touch ~/.bash_profile and run the

install script again you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.

Solution 2:[2]

The following command solved my problem:

sudo chown -R $USER:$(id -gn $USER) /Users/david/.config

Note: Change 'david' in the path for your user.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dillon23
Solution 2 David Jesus