[英]“nvm” command not recognized in new command line windows/tabs despite presence of “NVM_DIR” variable in both ~/.bashrc and ~/.bash_profile
[英]NVM Install Error: Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.
我只是擦除并重新格式化我的整个 Macbook Retina 驱动器以从头开始,安装自制软件,安装 xcode 并接受条款和条件,然后使用curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
并收到以下错误:
=> nvm is already installed in /Users/dillon/.nvm, trying to update using git
=> => Compressing and cleaning up git repository
=> Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.
=> Create one of them and run this script again
OR
=> Append the following lines to the correct file yourself:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
echo $PATH
返回/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
如果有帮助的话。
我尝试在 github 上打开一个问题,但没有收到回复
知道我可以做些什么来让 nvm 和节点正常运行吗?
尚未从nvm安装说明中阅读。 它解决了我的问题。
注意:在OS X上,如果运行安装脚本后未找到nvm:命令,则可能是以下原因之一:-
your system may not have a [.bash_profile file] where the command is set up. Simply create one with touch ~/.bash_profile and run the
再次安装脚本,您可能需要重新启动终端实例。 尝试在终端中打开新的标签页/窗口,然后重试。
以下命令解决了我的问题:
sudo chown -R $USER:$(id -gn $USER) /Users/david/.config
注意:为您的用户更改路径中的“david”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.