Mac OSX下卸载Nodejs

来源:互联网 发布:mac启动盘重装系统 编辑:程序博客网 时间:2024/06/05 23:02

卸载过程

1. 拷贝如下代码放到一个sh文件中(如uninstall_node.sh)

1
2
3
4
5
6
7
8
#!/bin/bash
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \
while read i; do
  sudo rm /usr/local/${i}
done
sudo rm -rf /usr/local/lib/node \
     /usr/local/lib/node_modules \
     /var/db/receipts/org.nodejs.*

 

2. 需要修改uninstall_node.sh文件属性

有的会提示 “Permission denied”

输入如下命令修改文件属性

1
chmod 777 uninstall_node.sh

 

3. mac终端下执行该文件,可以把uninstall_node.sh直接拖到终端,然后等上大概1分钟

可以看到node已经卸载了,输入node命令,提示command not found


原文地址:http://www.cnblogs.com/snandy/p/4418615.html


0 0
原创粉丝点击