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

推荐订阅源

量子位
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
Lohrmann on Cybersecurity
V
Visual Studio Blog
Cyberwarzone
Cyberwarzone
D
Docker
The Hacker News
The Hacker News
C
CERT Recently Published Vulnerability Notes
Vercel News
Vercel News
Project Zero
Project Zero
S
Schneier on Security
aimingoo的专栏
aimingoo的专栏
I
Intezer
腾讯CDC
M
MIT News - Artificial intelligence
Hugging Face - Blog
Hugging Face - Blog
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Vulnerabilities – Threatpost
G
Google Developers Blog
N
Netflix TechBlog - Medium
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
A
Arctic Wolf
S
Securelist
酷 壳 – CoolShell
酷 壳 – CoolShell
Cisco Talos Blog
Cisco Talos Blog
Recent Announcements
Recent Announcements
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
T
Threatpost
Latest news
Latest news
Blog — PlanetScale
Blog — PlanetScale
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
The GitHub Blog
The GitHub Blog
T
Tor Project blog
P
Proofpoint News Feed

博客园 - LungGiyo

frp 教程 nginx 跨域解决 001 局域网其他电脑也能访问wsl服务 关于IP送中的影响和解决办法 Antigravity google ai 接入高德MCP 1.3.2 git使用ssh密钥 连接远程仓库 dynadot域名 托管到cloudflare , 使用cloudflare 的CDN功能 003 二进制日志-binlog Django 项目开发整体步骤(0 开始)+进阶 磊科N60Pro刷机 uni的页面解析 前端技术知识扫盲篇 使用 Lucky 为群晖 / 极空间 NAS 全服务启用 HTTPS 安全访问 00 docker 命令总结 001 Python 基础 麒麟系统升级openssh至openssh-10.0p1 零信任访问控制系统aTrust 蓝屏 Python PyInstaller 打包、Pyarmor加密等 001 安装wsl 2 && 开启 WSL2 Oxidized的model
001 nvm 管理不同版本的 node 与 npm
LungGiyo · 2026-02-28 · via 博客园 - LungGiyo

nvm 与 n 的区别

nvm 简介  Node Version Manager 是使用最广泛的 Node.js 版本管理工具,尤其在开发团队中非常普及。

nvm 是一个独立于 node/npm 的外部 shell 脚本

n 是一个用 Node.js 自身写的极简版本管理器,目标是“最少配置,立即可用”。

n 命令是作为一个 node 的模块而存在,因此 node 命令相比 nvm 更加局限。

下载nvm 在nvm中下载nodejs,无需提前安装nodejs,如果安装了node需要先删除

ubuntu https://github.com/nvm-sh/nvm#installing-and-updating

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

安装nodejs

这里有一个 https://nodejs.org/en/download

1、查看可安装版本:
nvm list 

2、下载并安装(https://nodejs.org/zh-cn/download)
nvm install 12.13.0
nvm install 16
nvm install 20

3、使用 
nvm use 12.13.0

4、指定默认的node版本
nvm alias default v12.13.0    

5、卸载
nvm uninstall 11.13.0

检查:

node 20 对应npm版本是10.8

# Verify the Node.js version:
node -v # Should print "v20.19.3".
nvm current # Should print "v20.19.3".

# Verify npm version:
npm -v # Should print "10.8.2".