有必要说一下nvm,因为大家做前端对node都很熟悉吧。前端的很多项目中都依赖node,还有可能每个项目依赖的node版本不一样,这样我们就上了nvm。
nvm 是node Version Manage的简称,顾名思义node版本管理器。
 

一、安装

 
安装包下载地址 https://github.com/coreybutler/nvm-windows/releases。选择nvm-setup .zip
下载完咔叽咔叽无脑下一步就行。
 
最后验证一下是否安装成功。打开终端 输入
 
nvm
 
出现一下内容证明已经安装成功了。

 

二、使用

查看可安装node版本:nvm list available
 
 

安装node命令: nvm install<version>

 
//例如我想安装 node 10.23.0 nvm install 10.23.0
 

 
 

查看以安装node版本:nvm list

 
 
带*的是当前使用node版本
 

切换node版本:nvm use <version>

 

 
 
 
以下是nvm的一些命令,在下英语0级就不翻译了,免得误人子弟。
 1   nvm arch                     : Show if node is running in 32 or 64 bit mode.
2 nvm install <version> [arch] : The version can be a node.js version or "latest" for the latest stable version.
3 Optionally specify whether to install the 32 or 64 bit version (defaults to system arch).
4 Set [arch] to "all" to install 32 AND 64 bit versions.
5 Add --insecure to the end of this command to bypass SSL validation of the remote download server.
6 nvm list [available] : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.
7 nvm on : Enable node.js version management.
8 nvm off : Disable node.js version management.
9 nvm proxy [url] : Set a proxy to use for downloads. Leave [url] blank to see the current proxy.
10 Set [url] to "none" to remove the proxy.
11 nvm node_mirror [url] : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
12 nvm npm_mirror [url] : Set the npm mirror. Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url.
13 nvm uninstall <version> : The version must be a specific version.
14 nvm use [version] [arch] : Switch to use the specified version. Optionally specify 32/64bit architecture.
15 nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode.
16 nvm root [path] : Set the directory where nvm should store different versions of node.js.
17 If <path> is not set, the current root will be displayed.
18 nvm version : Displays the current running version of nvm for Windows. Aliased as v.

三、遇到的问题

值得注意的是:安装完nvm 之后 输入以下命令会出现错误

Could not retrieve https://nodejs.org/dist/latest/SHASUMS256.txt.

Get https://nodejs.org/dist/latest/SHASUMS256.txt: net/http: TLS handshake timeout

解决方案:

打开nvm安装目录找到到settings.txt 打开添加一下内容

node_mirror:npm.taobao.org/mirrors/node/
node_mirror:nom.taobao.org/mirrors/npm/

mac下下载不了node

解决方案: 直接去官网下载

例如10.23.0版本,node-v10.23.0-darwin-x64.tar.xz 点击下载。

然后放进/Users/用户名/.nvm/versions/node下然后以次命名

最新文章

  1. MySQL 启动原理剖析
  2. SignalR入门之多平台SignalR服务端
  3. 神奇的计算器dc和bc
  4. SpringMVC中使用Jcaptcha实现校验码验证
  5. [C# 基础知识系列]专题十六:Linq介绍
  6. Android 添加子视图(addView和setView)
  7. JVM启动过程——JVM之一
  8. HDU 3790 最短路径问题 (SPFA)
  9. 【UOJ #280】【UTR #2】题目难度提升
  10. tornado 增加日志模块
  11. win32 安装 xcache扩展
  12. 浅谈canvas绘画王者荣耀--雷达图
  13. pipeline结合GridSearchCV的一点小介绍
  14. java多线程的编程实例
  15. 算法与数据结构(六) 迪杰斯特拉算法的最短路径(Swift版)
  16. xml的作用
  17. oracle新建对象 权限管理
  18. how to check the computer is 32 bit or 64bit in linux
  19. dedecms首页去掉index.html怎么设置
  20. shell 查看去掉windons中的换行符

热门文章

  1. 解决xcode每次编译都需要输入用户名和密码
  2. python利用matplotlib生成迷宫
  3. angular11给Echarts添加点击事件,无脑抄代码的时候到了~~ 超好用
  4. webSocket前端+nodejs后端简单案例多人在线聊天
  5. 【题解】[LNOI2022] 盒
  6. Unity自定义Button
  7. drf入门规范、序列化器组件、视图组件、请求与响应
  8. [USACO17JAN]Cow Dance Show S更新ing
  9. javaWeb03-请求转发和请求重定向【包含浏览器与响应编码格式不一致的解决方法】
  10. 计算机网络基础07 DNS概述