nvm 不断“忘记"新终端会话中的节点 [英] nvm keeps "forgetting" node in new terminal session
本文介绍了nvm 不断“忘记"新终端会话中的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ nvm ls
:
.nvm
v0.11.12
v0.11.13
我必须在每个会话中继续点击 nvm use v.0.11.13
:
I have to keep hitting nvm use v.0.11.13
in every session:
.nvm
v0.11.12
-> v0.11.13
我已经尝试了 brew
安装以及官方安装脚本.
I've tried both the brew
install, as well as the official installation script.
我的 .profile
用于 brew 版本:
My .profile
for the brew version:
#nvm
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
对于 install.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
对我做错了什么有任何线索吗?
推荐答案
尝试 nvm alias default
.例如:
$ nvm 别名默认 0.12.7
这会在您的 shell 中设置默认节点版本.然后通过关闭 shell 窗口,打开一个新窗口来验证更改是否仍然存在,然后:node --version
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屋!
查看全文