Nvm: NVM, Node, NPM not available after closing Terminal session

Created on 30 Dec 2016  路  3Comments  路  Source: nvm-sh/nvm

  • Operating system and version: macOS Sierra v10.12.2

  • nvm debug output:


-bash: nvm: command not found

  • nvm ls output:

-bash: nvm: command not found

  • How did you install nvm? (e.g. install script in readme, homebrew):
    Manual Install
  • What steps did you perform?
    I followed Manual Install with Git.
  • What happened?
    NVM, Node, NPM is installed during the first try. But, when I exit Terminal, NVM, Node, NPM is not there. I've tried node -v, npm -v and it says -bash: nvm: command not found
  • What did you expect to happen?

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?
    This is the part I don't understand, how do I add export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm to my .bashrc, .bash_profile, .zshrc ?

There is no .bashrc, bash_profile or .zshrc in my $HOME folder.

  • If you are having installation issues, or getting "N/A", what does curl -v nodejs.org/dist/ print out?


Mac OS installing nvm profile detection

Most helpful comment

The first step is to manually create an empty ~/.bash_profile file, and then, add these lines to it:

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

After doing that, and reopening your terminal, what happens?

All 3 comments

The first step is to manually create an empty ~/.bash_profile file, and then, add these lines to it:

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

After doing that, and reopening your terminal, what happens?

Sorry for being a novice, but how to I add these lines? That's the problem I'm having now. Do I just copy these entirely and just paste to terminal? Or do I have to do something before or after?

You do need to know how to edit files in the terminal, I'm afraid. You can learn vi, or emacs, or nano - or you can use a graphical editor that allows you to edit dotfiles (files whose names start with a "."). http://vim-adventures.com may be useful.

However, while I'm happy to help, teaching terminal basics is out of scope of this repo, and is something you'll need to learn before being able to use node, nvm, as well as most developer tools - feel free to keep asking questions here and I'll keep trying to help :-) I'll close this for now.

Was this page helpful?
0 / 5 - 0 ratings