在window上管理nodejs版本,安装nvm-windows
第一次安装使用nvm-windows,会遇到好多坑,请仔细按一下步骤安装:
-
在Windows下完全卸载已安装的node.js
- 从卸载程序卸载程序和功能,也可以直接右键node.js的安装包并选择卸载。
- 重新启动(或者重新启动任务管理器杀死所有与节点相关的进程)。
- 从下列的目录中找到相关的内容并删除掉:
- C:\Program Files (x86)\nodejs
- C:\Program Files\nodejs
- C:\Users{User}\AppData\Roaming\npm(或%appdata%\npm)
- C:\Users{User}\AppData\Roaming\npm-cache(或%appdata%\npm-cache)
- 检查%PATH%环境变量以确保没有引用Nodejs或npm存在。
- 重新启动电脑。
-
下载nvm-windows
地址:https://github.com/coreybutler/nvm-windows/releases
下载最新版本安装包即可:

解压后里面是nvm-setup.exe安装文件,默认安装即可,记住默认安装哦,不然安装node时有可能没有权限而无法创建node快捷方式。
打开CMD窗口,直行nvm,如果显示版本等信息,则说明安装成功。
C:\Users\Administrator>nvm
Running version 1.1.8.
Usage:
nvm arch : Show if node is running in 32 or 64 bit mode.
nvm current : Display active version.
nvm install <version> [arch] : The version can be a specific version, "latest" for the latest current version, or "lts" for the
most recent LTS version. Optionally specify whether to install the 32 or 64 bit version (defaults
to system arch). Set [arch] to "all" to install 32 AND 64 bit versions.
Add --insecure to the end of this command to bypass SSL validation of the remote download server.
nvm list [available] : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.
nvm on : Enable node.js version management.
nvm off : Disable node.js version management.
nvm proxy [url] : Set a proxy to use for downloads. Leave [url] blank to see the current proxy.
Set [url] to "none" to remove the proxy.
nvm node_mirror [url] : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
n

本文详细指导如何在Windows系统中正确卸载、重置和安装nvm-windows,包括清理环境变量、更换下载源,以及常见错误解决方案。通过nvm管理不同Node.js版本,如查看、安装、切换和卸载,确保高效且无误的开发环境。
最低0.47元/天 解锁文章
1322

被折叠的 条评论
为什么被折叠?



