NodeJs——nvm安装和使用

简介: NodeJs——nvm安装和使用

前言

今天要编译一个其他nodejs版本的程序,然后就去github找找看看是不是有相应的nodejs版本管理工具,然后就找到了!

nvm-windows : https://github.com/coreybutler/nvm-windows

步骤

主要分为安装和使用两个步骤~

安装

下载

下载地址 : https://github.com/coreybutler/nvm-windows/releases/

本次安装的为1.17版本

安装

  1. 解压双击nvm-setup.exe并同意协议

  2. 选择nvm安装路径

安装路径不可带空格

  1. 选择nodejs路径

  2. 确认安装即可

  3. 安装完确认

  4. 验证
nvm version

使用

命令列表

$ nvm --help
Running version 1.1.7.
Usage:
  nvm arch                     : Show if node is running in 32 or 64 bit mode.
  nvm install <version> [arch] : The version can be a node.js version or "latest" for the latest stable versio
n.
                                 Optionally specify whether to install the 32 or 64 bit version (defaults to s
ystem 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 rem
ote download server.
  nvm list [available]         : List the node.js installations. Type "available" at the end to see what can b
e 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 [u
rl] 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 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.

修改镜像源

##nodejs
nvm  node_mirror https://npm.taobao.org/mirrors/node/
##npm
nvm npm_mirror https://npm.taobao.org/mirrors/npm/

查看node可安装版本

nvm ls available

nvm ls 是nvm list的简写

安装nodejs

## 安装最新版本
nvm install latest
## 安装指定版本
nvm install 14.15.0

切换版本

nvm use 15.8.0

卸载nodejs

nvm uninstall 15.8.0

报错

切换版本报错

C:\Users\WangYang>nvm use 14.15.0
exit status 1: 'D:\Program' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

因为目录路径包含空格,仓库中回复是在1.1.8版本会解决,我这里是直接卸载重新安装了。

学无止境,谦卑而行.

目录
相关文章
|
1月前
|
JavaScript
NodeJs的安装
文章介绍了Node.js的安装步骤和如何创建第一个Node.js应用。包括从官网下载安装包、安装过程、验证安装是否成功,以及使用Node.js监听端口构建简单服务器的示例代码。
NodeJs的安装
|
15天前
|
JavaScript 开发工具 git
已安装nodejs但是安装hexo报错
已安装nodejs但是安装hexo报错
19 2
|
5天前
|
缓存 资源调度 JavaScript
npx与npm的差异解析,以及包管理器yarn与Node版本管理工具nvm的使用方法详解
npx与npm的差异解析,以及包管理器yarn与Node版本管理工具nvm的使用方法详解
13 0
|
29天前
|
存储 JavaScript 前端开发
Node 版本控制工具 NVM 的安装和使用(Windows)
本文介绍了NVM(Node Version Manager)的Windows版本——NVM for Windows的安装和使用方法,包括如何安装Node.js的特定版本、列出已安装版本、切换使用不同版本的Node.js,以及其他常用命令,以实现在Windows系统上对Node.js版本的便捷管理。
Node 版本控制工具 NVM 的安装和使用(Windows)
|
9天前
|
Web App开发 JavaScript 前端开发
JavaWeb 22.Node.js_简介和安装
JavaWeb 22.Node.js_简介和安装
|
1月前
|
JavaScript Linux 开发者
一个用于管理多个 Node.js 版本的安装和切换开源工具
【9月更文挑战第14天】nvm(Node Version Manager)是一个开源工具,用于便捷地管理多个 Node.js 版本。其特点包括:版本安装便捷,支持 LTS 和最新版本;版本切换简单,不影响开发流程;多平台支持,包括 Windows、macOS 和 Linux;社区活跃,持续更新。通过 nvm,开发者可以轻松安装、切换和管理不同项目的 Node.js 版本,提高开发效率。
|
18天前
|
JavaScript 算法 内存技术
如何降低node.js版本(nvm下载安装与使用)
如何降低node.js版本(nvm下载安装与使用)
|
18天前
|
缓存 JavaScript Oracle
Node.js版本管理工具之NVM
Node.js版本管理工具之NVM
|
1月前
|
JavaScript 前端开发 Linux
|
1月前
|
JavaScript Linux API
安装NodeJs,好啊好啊
安装NodeJs,好啊好啊