nvm保持“忘记"状态.新终端会话中的节点 [英] nvm keeps "forgetting" node in new terminal session

查看:112
本文介绍了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 用于酿造版本:

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 alias default 0.12.7

这将在您的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆