By accessing the website and accepting the Cookie Policy, you agree to use the cookies provided by the Site in accordance with to analyze traffic, remember your preferences, and optimize your experience.
nvm卸载指定node.js版本号
nvm nodejs    2019-04-18 10:26:40    7234    0    0
emengweb   nvm nodejs

nvm 删除 移除 node.js

正常用nvm卸载node.js版本号的命令是:

nvm uninstall 6.9.2

 

但是遇到了权限问题:

file is not writable: $NVM_DIR/versions/node/v6.9.2/bin/gulp
Cannot uninstall, incorrect permissions on installation folder.
This is usually caused by running `npm install -g` as root. Run the following commands as root to fix the permissions and then try again.

 chown -R xgllseo "$NVM_DIR/versions/node/v6.9.2"
 chmod -R u+w "$NVM_DIR/versions/node/v6.9.2"

大意是说有使用过root用户执行npm install -g命令,导致$NVM_DIR/versions/node/v6.9.2/bin/npm这个目录没有写权限,需要修改相应目录的权限。

 

尝试sudo卸载

改权限太麻烦了些,尝试sudo用root用户直接卸载。

$ sudo nvm uninstall 4.4.5
sudo: nvm: command not found

 

修改目录权限

查下 $NVM_DIR这个变量指向那个目录

$ echo $NVM_DIR
/Users/xgllseo/.nvm

其实只要安装之前给的提示做:

sudo chown -R xgllseo "$NVM_DIR/versions/node/v6.9.2"
sudo chmod -R u+w "$NVM_DIR/versions/node/v6.9.2"

再次执行

nvm uninstall 6.9.2

http://www.01happy.com/nvm-uninstall-node-permission/

上一篇: linux 中卸载 node 和 nvm

下一篇: Debian 使用 nvm 安装 Nodejs

7234 人读过
文档导航