nvm使用
NVM使用
常用指令
安装指定版本:
nvm install
支持简写,如 nvm install 20 自动安装最新 20.x 版本。
安装最新稳定版:
nvm install stable。
卸载指定版本:
nvm uninstall
切换到指定版本:
nvm use
查看当前使用版本:
nvm current。
查看已安装版本:
nvm list 或 nvm ls。
查看可安装的在线版本:
nvm list available 或 nvm ls available。
修改源以加速安装
1 |
|
设置全局 npm 包安装路径:
npm config set prefix “D:\path\to\node_global”。
设置 npm 缓存路径:
npm config set cache “D:\path\to\node_cache”。
查看路径配置:
npm get prefix(全局路径) 和 npm get cache(缓存路径)。
启用/禁用 NVM:
nvm on(启用) 或 nvm off(禁用)。
创建版本别名:
nvm alias <别名>
安装
Linux:
下载gitee加速下载脚本然后运行即可。版本v0.40.1
Windows:
github版本为1.2.2
nvm使用
https://blog.computerqwq.top/2025/05/16/nvm-shi-yong/