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 命令即可。

目录
相关文章
|
1月前
|
存储 Cloud Native Java
Windows下Minio的安装以及基本使用
MinIO 是一个开源的云原生分布式对象存储系统,兼容亚马逊S3接口,适合存储大容量非结构化数据。本文介绍Windows下MinIO的安装与基本使用:通过以上步骤,您可以在Windows环境中成功安装并使用MinIO。
263 17
|
2月前
|
关系型数据库 MySQL 数据库
【MySQL基础篇】MySQL概述、Windows下载MySQL8.0超详细图文安装教程
在这一章节,主要介绍两个部分,数据库相关概念及MySQL数据库的介绍、下载、安装、启动及连接。接着,详细描述了MySQL 8.0的版本选择与下载,推荐使用社区版(免费)。安装过程包括自定义安装路径、配置环境变量、启动和停止服务、以及客户端连接测试。此外,还提供了在同一台电脑上安装多个MySQL版本的方法及卸载步骤。最后,解释了关系型数据库(RDBMS)的特点,即基于二维表存储数据,使用SQL语言进行操作,格式统一且便于维护。通过具体的结构图展示了MySQL的数据模型,说明了数据库服务器、数据库、表和记录之间的层次关系。
【MySQL基础篇】MySQL概述、Windows下载MySQL8.0超详细图文安装教程
|
2月前
|
安全 关系型数据库 MySQL
Windows Server 安装 MySQL 8.0 详细指南
安装 MySQL 需要谨慎,特别注意安全配置和权限管理。根据实际业务需求调整配置,确保数据库的性能和安全。
302 9
|
2月前
|
机器学习/深度学习 并行计算 异构计算
WINDOWS安装eiseg遇到的问题和解决方法
通过本文的详细步骤和问题解决方法,希望能帮助你顺利在 Windows 系统上安装和运行 EISeg。
143 2
|
3月前
|
网络安全 Windows
Windows server 2012R2系统安装远程桌面服务后无法多用户同时登录是什么原因?
【11月更文挑战第15天】本文介绍了在Windows Server 2012 R2中遇到的多用户无法同时登录远程桌面的问题及其解决方法,包括许可模式限制、组策略配置问题、远程桌面服务配置错误以及网络和防火墙问题四个方面的原因分析及对应的解决方案。
239 4
|
3月前
|
NoSQL Linux PHP
如何在不同操作系统上安装 Redis 服务器,包括 Linux 和 Windows 的具体步骤
本文介绍了如何在不同操作系统上安装 Redis 服务器,包括 Linux 和 Windows 的具体步骤。接着,对比了两种常用的 PHP Redis 客户端扩展:PhpRedis 和 Predis,详细说明了它们的安装方法及优缺点。最后,提供了使用 PhpRedis 和 Predis 在 PHP 中连接 Redis 服务器及进行字符串、列表、集合和哈希等数据类型的基本操作示例。
165 4
|
4月前
|
数据安全/隐私保护 Windows
安装 Windows Server 2019
安装 Windows Server 2019
141 1
|
4月前
|
Windows
安装 Windows Server 2003
安装 Windows Server 2003
|
4月前
|
Windows Python
Windows安装dlib,遇到问题汇总解决
Windows安装dlib,遇到问题汇总解决
189 4
|
4月前
|
NoSQL Shell MongoDB
Windows 平台安装 MongoDB
10月更文挑战第10天
104 0
Windows 平台安装 MongoDB