惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Heimdal Security Blog
SecWiki News
SecWiki News
H
Hacker News: Front Page
N
News | PayPal Newsroom
L
LINUX DO - 最新话题
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
AI
AI
C
Cybersecurity and Infrastructure Security Agency CISA
Scott Helme
Scott Helme
PCI Perspectives
PCI Perspectives
S
Securelist
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cyberwarzone
Cyberwarzone
A
Arctic Wolf
Forbes - Security
Forbes - Security
T
Tor Project blog
Spread Privacy
Spread Privacy
WordPress大学
WordPress大学
I
Intezer
Martin Fowler
Martin Fowler
Help Net Security
Help Net Security
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cisco Talos Blog
Cisco Talos Blog
Latest news
Latest news
博客园 - 司徒正美
W
WeLiveSecurity
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
P
Palo Alto Networks Blog
Google DeepMind News
Google DeepMind News
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
V
Vulnerabilities – Threatpost
Jina AI
Jina AI
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
T
Threatpost
P
Privacy International News Feed
人人都是产品经理
人人都是产品经理
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - 子墨老师

基于Hutool的poi导出excel表格【升级更新】 如何设置wps单元格下拉选项设置 Caused by: org.jasypt.exceptions.EncryptionOperationNotPossibleException: Encryption raised an exception ZoomIt的使用与快捷键 springboot项目中使用Java 8的日期时间API 基于springboot系统,如何跟踪会话过期,浏览器会话标识是否收到正常响应,存储,并在后续请求保持携带 SpringBoot+MyBatis实现数据库字段加密 Vue2中能否实现输入中文自动转化为拼音, 且不带音调 Excel导出问题:accessExternalStylesheet 解构赋值+扩展运算符在数组和对象上的应用例子 收藏一下JDK下载地址 介绍几个axios接口请求顺序的问题 vue cli的介绍 Failed to start nginx.service: Unit nginx.service not found. 如何实现文件批量重命名后再进行批量打包下载 如何能成功在centos7下安装nodejs18+以上版本 基于ConcurrentMap锁机制的NFS文件合并方案 基于ConcurrentMap锁机制的NFS分片上传方案 如何将已经存在的本地项目源码关联到远程git仓库中 gitee如何使用 centos7安装php+wordpress
centos7下卸载nodejs源码包
子墨老师 · 2025-08-20 · via 博客园 - 子墨老师

当前若在centos7上安装的nodejs是基于源码包,或是 当前 Node.js 是通过源码解压后通过软链接方式安装到 /usr/local/bin的,以下是彻底卸载的步骤

1.删除软链接

sudo rm -f /usr/local/bin/node   # 删除node软链接
sudo rm -f /usr/local/bin/npm    # 删除npm软链接
sudo rm -f /usr/local/bin/npx    # 若存在npx软链接

2.删除源码安装目录

找到当初解压的 Node.js 源码目录(如 /opt/node-v16.20.2-linux-x64),删除整个目录:

sudo rm -rf /opt/node-v16.20.2-linux-x64  # 替换为实际路径

3.清理全局npm包和缓存

sudo rm -rf /usr/local/lib/node_modules  # 全局npm包目录
sudo rm -rf ~/.npm                       # 用户npm缓存
sudo rm -rf ~/.node-gyp                  # 编译工具缓存

4.检查残留文件

手动检查并删除以下可能残留的配置文件:

sudo rm -f /usr/local/include/node       # 头文件
sudo rm -f /usr/local/share/man/man1/node.1  # 手册页
sudo rm -f ~/.npmrc                      # npm配置文件

5.验证卸载

node -v
npm -v

注意事项​

  • ​权限问题​:若删除时提示权限不足,使用 sudo并确认路径正确。
  • ​多版本管理​:若后续需重新安装,推荐使用 nvm管理版本,避免手动操作风险
  • ​环境变量​:检查 ~/.bashrc或 /etc/profile,删除与 Node.js 相关的 PATH或 NODE_PATH设置