问题
My problem is almost the same as this one but i already set the default alias.
Once i open a new console nvm
does not load the default node, this problem is also present with some SublimeText3 plugins (eslint, jscs for example).
The only way to make it work is to add nvm use default
after loading nvm
but i thik i am doing something wrong.
How can i make it work without the hack?
My configuration
- brew 0.9.5
- nvm 0.26.0 (installed using brew)
- zsh (with oh-my-zsh)
I have nvm
sourced in .zshenv
with th following config:
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
# nvm use default # <-- remove comment to make node available
nvm
is configured as follows (result of the command nvm ls
):
iojs-v3.0.0
v0.12.7
default -> iojs (-> iojs-v3.0.0)
node -> stable (-> v0.12.7) (default)
stable -> 0.12 (-> v0.12.7) (default)
iojs -> iojs-v3.0 (-> iojs-v3.0.0) (default)
回答1:
oh-my-zsh includes a nvm plugin, I would recommend you to use it, but first
- remove from your .zshenv all changes
- remove the nvm install with brew uninstall
- install nvm using curl (official installation):
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.0/install.sh | bash
this wont configure your profile to use it yet. - edit the file at your users home called .zshrc finding the plugins section and there include
nvm
save it and source your profile or close and open again your terminal. - use nvm to install a node version and set the default alias
来源:https://stackoverflow.com/questions/32069548/nvm-cannot-load-default-node-with-default-alias-set