安装 NVM

  NVM 下载:https://github.com/coreybutler/nvm-windows

安装 Node

注意:如果没有翻墙默认源可能安装npm失败,请参考下一节“安装 NPM”修改镜像源地址。

  • 查看可用版本:

    nvm ls available
  • 安装Node:
    nvm install [version]
  • 指定使用版本:
    nvm use [version]

安装 NPM

  nvm全称Node Version Manager是 Nodejs 版本管理器,它让我们能方便的对 Nodejs 的版本进行切换。

  使用默认源可能安装npm失败,需要修改../nvm/settings.txt文件,添加如下配置。

  root: C:\dev\nvm
path: C:\dev\nodejs
arch: 64
proxy: none
node_mirror: http://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/

安装NRM

  nrm(npm registry manager)是npm的镜像源管理工具,有时候国外资源太慢,那么我们可以用这个来切换镜像源。

  • 安装nrm

    npm install nrm -g
  • 查看可用镜像源

    nvm>nrm ls
    
    * npm ---- https://registry.npmjs.org/
    cnpm --- http://r.cnpmjs.org/
    taobao - https://registry.npm.taobao.org/
    nj ----- https://registry.nodejitsu.com/
    rednpm - http://registry.mirror.cqupt.edu.cn/
    npmMirror https://skimdb.npmjs.com/registry/
    edunpm - http://registry.enpmjs.org/
  • 选择使用镜像源
    nrm use taobao

NVM 命令

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 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/npm/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 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.

参考链接

https://www.runoob.com/w3cnote/nvm-manager-node-versions.html

https://blog.csdn.net/qq_27626333/article/details/77857223

使用NVM管理Node - Windows的更多相关文章

  1. windows使用nvm管理node不同版本

    最近项目需要升级,新技术需要的node版本较高,而新node不兼容旧版本node,而原项目仍需要继续维护,所以就需要在本地有多个版本的node,基本原理是在环境配置中修改系统变量node的版本文件夹路 ...

  2. nvm管理node之后,安装npm包出现的问题

    在学习Node.js连接MySQL时,使用nvm安装node6.10.0,在项目目录下npm install mysql 出问题. 在查询解决方法后,得知是因为配置文件有问题 package.json ...

  3. win上使用nvm管理node版本

    win上使用nvm管理node版本 若想让nvm管理机器上所有的node版本,首先需要卸载电脑上已有的node(很重要), 然后下载nvm在win上的安装包 windows-nvm的下载地址 下载 下 ...

  4. 【前端开发】nrm切换淘宝镜像&nvm管理node版本及切换

    说明:nrm是切换淘宝镜像用的,nvm是node的版本切换用的(可在自己电脑安装多个版本node,便于不同项目的支持) 一.nrm的安装及常见命令: 安装nrmnpm install -g nrm 查 ...

  5. Mac下nvm管理node.js版本问题

    本篇文章主要是针对已经安装了node.js和nvm管理工具小伙伴遇到的问题. 管理工具有两个,一个是nvm,还有一个是nnvm的好处就是可以管理多个node版本,而且可以切换想要的版本,可以安装一个稳 ...

  6. 【node】使用nvm管理node版本

    写在前面 nvm(nodejs version manager)是nodejs的管理工具,如果你想快速更新node版本,并且不覆盖之前的版本:或者想要在不同的node版本之间进行切换: 使用nvm来安 ...

  7. 使用nvm管理node版本时,各个版本下公用npm安装的插件问题

    因为使用了NVM(node版本管理工具),所以在切换node版本的时候安装的插件不能共享使用,必须重新安装,导致不必要的工作量 所以我将npm(node包管理工具提取出来) 进行node版本之间的共享 ...

  8. 使用nvm管理node不同版本,安装,环境配置,切换不同版本的node版本

    文章包含以下内容: 一.下载地址 二.nvm-noinstall.zip安装 三.nvm-setup.zip安装 四.测试安装以及使用 一.下载地址 https://github.com/coreyb ...

  9. ubuntu 安装 nvm 管理Node.js 以及vim 插件增强

    安装curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bashsource ~/.bashr ...

随机推荐

  1. .Net Core知识点

    1:const,readonly,和get访问器,三者都可在自己的生命域里赋值,但是编译器也是可以在构造函数里进行初始化赋值的 2:Debugger.IsAttached 属性 http://msdn ...

  2. springboot新增swagger2配置

    转自http://www.cnblogs.com/jtlgb/p/8532433.html SpringBoot整合Swagger2 相信各位在公司写API文档数量应该不少,当然如果你还处在自己一个人 ...

  3. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [app2.xml]: Instantiation of bean failed; nested exception is org.spr

    在学习spring整合hubernate时遇到的问题.c3p0遇到了一个问题,老连不上,显示java.lang.NoClassDefFoundError:com.mchange.v2.ser.Indi ...

  4. Sublime text 替换成对标签 首尾匹配的HTML 标签

    按Cmd-Shift-K (Win: Ctrl-Shift-') 就能选中这组标签

  5. 让windows10的右键菜单既显示传统cmd又显示powershell

    在windows10的资源管理器中,按住shift点击右键,只显示 open powershell window here,却没有传统的cmd 解决方法就是修改注册表: HKEY_LOCAL_MACH ...

  6. CentOS 7 Gitlab+Jenkins持续集成+自动化部署

    基于上次的环境<部署Gitlab+Jenkins持续集成环境> 来实现自动化部署 系统管理–>插件管理–>安装以下插件: Credentials Plugin(默认已经安装) ...

  7. 304. Range Sum Query 2D - Immutable(动态规划)

    Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper lef ...

  8. 阿里云新老用户购买 2核8G云服务器5M带宽

    这次阿里云活动的力度还是很大的,2核8G云服务器5M带宽 3年才2070 ,还是很值的购买的. 也放一个我的团战队连接,欢迎大家一起拼低价 https://m.aliyun.com/act/team1 ...

  9. HTTP笔记1

    传输层:提供进程地址 TCP:传输控制协议,面向连接的协议:通信前需要建立虚拟链路:结束后拆除链路.端口号:0-65535 UDP:用户报文协议,无连接的协议.端口号:0-65535 IANA(互联网 ...

  10. 软件测试实验四----mujava变异测试

    1.整个路径结构 2.具体内容 2.1mujava的安装 2.1.1更改CLASSPATH环境变量,使命令行可以找到mujava的路径,方便之后mujava的使用. 2.1.2在系统某一路径下按照格式 ...