[英]“nvm” command not recognized in new command line windows/tabs despite presence of “NVM_DIR” variable in both ~/.bashrc and ~/.bash_profile
[英]You have $NVM_DIR set to “/root/.nvm”, but that directory does not exist. Check your profile files and environment
我试图在卸载它(作为根用户)后重新安装 nvm(作为新用户),但显然它不起作用。 请告诉我如何解决这个问题。
user@site-beta:~/htdocs$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13527 100 13527 0 0 105k 0 --:--:-- --:--:-- --:--:-- 105k
You have $NVM_DIR set to "/root/.nvm", but that directory does not exist. Check your profile files and environment.
bash
之前,审核脚本以确保它没有做任何您不同意的事情总是一个好主意。 您可以通过删除| bash
来做到这一点。 | bash
段在curl
命令末尾:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh
| bash
再次运行命令 | bash
附在末尾。 您使用的 URL 将根据 nvm 的最新版本而变化,但截至目前,可以通过键入以下内容下载并执行该脚本:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
.bashrc
文件:source ~/.bashrc
nvm list-remote
nvm install v14.16.0
node -v
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.