nvm keeps "forgetting" node in new terminal session

asked11 years ago
last updated10 years ago
viewed238.1k times
Up Vote765Down Vote

Upon using a new terminal session in OS X, nvm forgets the node version and defaults to nothing:

$ nvm ls:

.nvm
     v0.11.12
     v0.11.13

I have to keep hitting nvm use v.0.11.13 in every session:

.nvm
     v0.11.12
->   v0.11.13

I've tried both the brew install, as well as the official installation script.

My .profile for the brew version:

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

And for the install.sh script:

$ curl https://raw.githubusercontent.com/creationix/nvm/v0.10.0/install.sh | bash

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

Any clue to what I'm doing wrong?