问题描述
我正在尝试按照这些说明
我在终端输入这个命令:
I typed in this command in terminal:
$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh
运行安装后,我重新启动终端并尝试使用以下命令安装 Node.js:
After running the install, I restart the terminal and attempt to install Node.js with this command:
$ nvm install 0.8
但我得到了回应:
-bash: nvm: command not found
我不确定我在这里做错了什么.
I'm not sure what I am doing wrong here.
附加信息--
我一直在寻找其他帖子和论坛的解决方案.我使用
I've been looking around for solutions from other posts and forums. I found another solution using
$ git clone git://github.com/creationix/nvm.git ~/.nvm
但是每次我尝试时都会超时.任何帮助,将不胜感激.谢谢.
but this times out every time I attempt that. Any help would be appreciated. Thanks.
推荐答案
检查您的 .bash_profile
、.zshrc
或 .profile
文件.您很可能在安装过程中遇到了问题.
Check your .bash_profile
, .zshrc
, or .profile
file. You most likely had a problem during the installation.
您应该在其中一个文件的末尾添加以下内容.
You should have the following at the end of one of those files.
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM
.$HOME/.nvm/nvm.sh 与 source $HOME/.nvm/nvm.sh
参见:获取文件
您还可以检查是否有 .nvm
文件夹.
You can also check to see if you have a .nvm
folder.
ls -a | grep .nvm
如果您缺少该文件夹,则安装无法运行 git 命令.这可能是由于在代理后面.尝试运行以下命令.
If you're missing that folder then the installation failed to run the git command. This could be due to being behind a proxy. Try running the following instead.
git clone http://github.com/creationix/nvm.git .nvm
这篇关于节点版本管理器安装 - 未找到 nvm 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!