Windows10安装nvm

简介: Windows10安装nvm

nvm 的底层设计是仅支持 Linux/MaxOS 的,因此 Windows 环境下需要使用其衍生版本,为: nvm-windowsGithub地址


下载

GitHub 上下载即可,下载地址

nvm-windows下载.png


安装

下一步下载的压缩包解压后是一个 exe 文件,双击安装即可,注意 安装的时候路径中不能有中文


安装完成后测试,打开 CMD 终端,输入 nvm 即可。得到如下输出即表示安装成功。

$ 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.
  nvm npm_mirror [url]         : Set the npm mirror. Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url.
  nvm uninstall <version>      : The version must be a specific version.
  nvm use [version] [arch]     : Switch to use the specified version. Optionally use "latest", "lts", or "newest".
                                 "newest" is the latest installed version. Optionally specify 32/64bit architecture.
                                 nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode.
  nvm root [path]              : Set the directory where nvm should store different versions of node.js.
                                 If <path> is not set, the current root will be displayed.
  nvm version                  : Displays the current running version of nvm for Windows. Aliased as v.点击复制复制失败已复制


换源

老生常谈,一键复制即可

$ nvm node_mirror https://npmmirror.com/mirrors/node点击复制复制失败已复制


采坑

Cannot create a file when that file already exists.

通过 nvm install x.x.x 之后启用这个版本,例如:

$ nvm install 14.18.0
$ nvm use 14.18.0
exit status 1: Cannot create a file when that file already exists.点击复制复制失败已复制


问题产生的原因

安装 nvm 过程中,会要设置 nodejs 的快捷连接 symlinkwindows 默认是 C:\Program Files\nodejs


nvm 就是通过修改快捷链接来改变node的版本


然而之前系统中已经安装了 nvm有残留,具体可以看此issue


解决办法

卸载 nvm ,删除 C:\Users\User Name\AppData\Roaming\nvm 文件夹,重新安装。


Access is denied.

$ nvm use 14.18.0
exit status 1: Access is denied.点击复制复制失败已复制


产生原因

由于安装路径自定义到了E盘,然后 node 后采用 nvm use x.x.x 来激活版本失败。


解决办法

管理员身份运行 CMD ,之后执行 nvm use x.x.x 命令即可。

目录
相关文章
|
14天前
|
iOS开发 MacOS Windows
Mac air使用Boot Camp安装win10 ,拷贝 Windows 文件时出错
Mac air使用Boot Camp安装win10 ,拷贝 Windows 文件时出错
|
4天前
|
存储 JavaScript 前端开发
Node 版本控制工具 NVM 的安装和使用(Windows)
本文介绍了NVM(Node Version Manager)的Windows版本——NVM for Windows的安装和使用方法,包括如何安装Node.js的特定版本、列出已安装版本、切换使用不同版本的Node.js,以及其他常用命令,以实现在Windows系统上对Node.js版本的便捷管理。
Node 版本控制工具 NVM 的安装和使用(Windows)
9-14|npm install --global windows-build-tools 安装太慢了,能够指定国内源
9-14|npm install --global windows-build-tools 安装太慢了,能够指定国内源
|
29天前
|
Windows
Windows操作系统部署安装Kerberos客户端
详细介绍了在Windows操作系统上部署安装Kerberos客户端的完整过程,包括下载安装包、安装步骤、自定义安装路径、修改环境变量、配置hosts文件和Kerberos配置文件,以及安装后的验证步骤。
43 3
Windows操作系统部署安装Kerberos客户端
|
20天前
|
SQL JavaScript 数据库
sqlite在Windows环境下安装、使用、node.js连接
sqlite在Windows环境下安装、使用、node.js连接
|
2月前
|
缓存 NoSQL Linux
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
|
28天前
|
网络安全 虚拟化 Windows
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
|
2月前
|
Ubuntu Linux 虚拟化
安装Windows Linux 子系统的方法:适用于windows 11 版本
本文提供了在Windows 11系统上安装Linux子系统(WSL)的详细步骤,包括启用子系统和虚拟化功能、从Microsoft Store安装Linux发行版、设置WSL默认版本、安装WSL2补丁,以及完成Ubuntu的首次安装设置。
111 2
|
2月前
|
API Docker Windows
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
这篇文章是一份关于Ollama工具的一站式使用指南,涵盖了在Windows系统上安装、使用和定制服务,以及实战案例。
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
|
2月前
|
网络安全 Windows
windows安装ssh服务
windows安装ssh服务
24 0