在 CentOS 企业版使用 n 安装 Node.js

April 12, 2020

公司的服务器是基于 CentOS 改装的企业版, NodeSource 仓库里没有这个系统版本, 无法直接安装。本文采用 n 安装方案

快速操作

yum install epel-release
yum install nodejs
node -v
# 显示的是旧版本
npm cache clean -f
# 清理缓存
npm install -g n
# 安装 n
n stable
# 安装稳定版 node

关闭当前终端, 重新打开

node -v
# 显示的是最新稳定版
n ls
# 查看安装的版本列表

参考链接


Profile picture

Written by xiaohai who lives and works in ShenZhen, building useful things.