nvm 不断“忘记";新终端会话中的节点 [英] nvm keeps "forgetting" node in new terminal session
本文介绍了nvm 不断“忘记";新终端会话中的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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?
解决方案
Try nvm alias default
. For example:
$ nvm alias default 0.12.7
This sets the default node version in your shell. Then verify that the change persists by closing the shell window, opening a new one, then:
node --version
这篇关于nvm 不断“忘记";新终端会话中的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文