我是一个初学者,在安装Node6.3.0时遇到了问题。
我成功地运行了以下命令:
brew install nvm但是当我尝试运行nvm命令时,我得到了"nvm命令未找到“的错误信息
nvm install 6.3.0从谷歌看来,我的.bash_profile可能有问题,但我没有发现任何有效的东西。现在我的.bash个人资料是这样的
this:export RBENV_ROOT=/usr/local/var/rbenv
rbenv > /dev/null; eval "$(rbenv init -)"
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin我知道需要为Node添加一些东西,但我不知道是什么,而且一旦我弄清楚如何安装6.3.0,我如何使它成为我的默认版本?
谢谢!
发布于 2018-05-21 02:20:11
对于Mac用户,我想提供一些我遵循的步骤,并帮助我安装Node Version Manager。nvm。
在Mac 上安装和使用nvm
从here.
位于~/.nvm位置的brew update brew install nvm
.nvm目录。mkdir ~/.nvm
.bash_profile文件,请在根级别创建一个.bash_profile:nano ~/.bash_profile
.bash_profile中,然后按CTRL + O和enter保存.bash_profile文件。按CTRL + X键退出编辑器:export NVM_DIR=~/.nvm source $(brew --prefix nvm)/nvm.sh
CMD + Q)终端或运行以下命令加载.bash_profile设置:source ~/.bash_profile
nvm ls命令以获取所有已安装nodejs版本的列表。发布于 2016-12-18 06:55:14
查看以下说明:
[~] brew info nvm
nvm: stable 0.20.0, HEAD
https://github.com/creationix/nvm
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/nvm.rb
==> Caveats
Add the following to $HOME/.bashrc, $HOME/.zshrc, or your shell's
equivalent configuration file:
source $(brew --prefix nvm)/nvm.sh
Node installs will be lost upon upgrading nvm. Add the following above
the source line to move install location and prevent this:
export NVM_DIR=~/.nvm本文摘自:Homebrew installs nvm but nvm can't be found afterwards?
https://stackoverflow.com/questions/41203466
复制相似问题