1

I am a beginner programmer having trouble installing node 6.3.0.

I successfully ran the command:

brew install nvm

but i get the error listed "nvm command not found" when I try to run

nvm install 6.3.0

From google it seems like I likely have an issue with my .bash_profile but nothing I've found works. Right now my .bash profile reads like

this:export RBENV_ROOT=/usr/local/var/rbenv
rbenv > /dev/null; eval "$(rbenv init -)"
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin

I know there needs to be something added for Node but I can't figure out what, also once I do figure out how to install 6.3.0, how do I make it my default version?

Thanks!

Will
  • 33
  • 1
  • 3

2 Answers2

2

For Mac OS X users I would like to provide some steps which I followed and helped me with the installation of Node Version Manager a.k.a. nvm.

Installing & using nvm on Mac OS X

  • Install homebrew from here.
  • Using homebrew install nvm

    brew update brew install nvm

  • Create .nvm directory at ~/.nvm location.

    mkdir ~/.nvm

  • Now if you don't have .bash_profile file setup for OS X terminal then please create a .bash_profile at the root level:

    nano ~/.bash_profile

  • Paste below code in the .bash_profile and press CTRL + O and press enter to save .bash_profile file. Press CTRL + X to exit from editor:

    export NVM_DIR=~/.nvm source $(brew --prefix nvm)/nvm.sh

  • Now either quite (CMD + Q) the terminal or run below command to load .bash_profile settings:

    source ~/.bash_profile

  • Now run nvm ls command to get the list of all installed nodejs versions.

S.Mishra
  • 3,394
  • 28
  • 20
1

Check out the following instructions:

[~] brew info nvm
nvm: stable 0.20.0, HEAD
https://github.com/creationix/nvm
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/nvm.rb
==> Caveats
Add the following to $HOME/.bashrc, $HOME/.zshrc, or your shell's
equivalent configuration file:

  source $(brew --prefix nvm)/nvm.sh

Node installs will be lost upon upgrading nvm. Add the following above
the source line to move install location and prevent this:

  export NVM_DIR=~/.nvm

this was taken from: Homebrew installs nvm but nvm can't be found afterwards?

Community
  • 1
  • 1
sebasaenz
  • 1,917
  • 2
  • 20
  • 25