zoukankan      html  css  js  c++  java
  • nvm的安装与使用

    nvm的安装与使用

    一、nvm的下载与安装

    1.1nvm下载

    • 官网下载点我下载
    • 点击下载1.1.7,nvm-setup.zip.(个人只安装过nvm-setup的因为安装和配置相对简单,其他的我没尝试过,有兴趣自己百度,也欢迎留言)

    1.2 nvm的安装

    反正一直都是下一步就可以了,只说几个注意的地方

    • 第一个是选择nvm的安装路径

    • 第二个是选择node的安装路径

    1.3检查nvm是否安装成功

    • 打开cmd输入命令nvm

    • 如下显示则安装成功

    • 命令提示解释

      #正在运行的nvm版本
      Running version 1.1.7.  
      
      Usage:
      #显示node是运行在32位还是64位
        nvm arch                     : Show if node is running in 32 or 64 bit mode.
      #安装node 可指定version(版本)或者最新稳定版latest,参数arch指定安装32位还是64位,在命令尾部添加 --insecure可以绕过远程下载服务器的SSL验证。
        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.
      #  列出已经安装的node,可选参数available查看网络可以安装哪些版本的node。list别名为ls。                    
        nvm list [available]         : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.
        #启用node版本管理
        nvm on                       : Enable node.js version management.
        #关闭node版本管理
        nvm off                      : Disable node.js version management.
        #用于设置下载的代理。 将[url]留空以查看当前代理。将[url]设置为“ none”以删除代理。
        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.
        #设置节点镜像。 默认为https://nodejs.org/dist/。 将[url]留空将使用默认url。
        nvm node_mirror [url]        : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
        #设置npm镜像。 默认为https://github.com/npm/cli/archive/。 将[url]空白保留为默认url。
        nvm npm_mirror [url]         : Set the npm mirror. Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url.
        #卸载指定版本node
        nvm uninstall <version>      : The version must be a specific version.
        #切换为使用指定的版本。 (可选)指定32/64位体系结构。 nvm use <arch>将继续使用所选版本,但切换到32/64位模式。
        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应该存储不同版本的node.js的目录。 如果未设置<path>,将显示当前根目录。
        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.
        #显示用于Windows的nvm的当前运行版本。 可简化为v。
        nvm version                  : Displays the current running version of nvm for Windows. Aliased as v.
      
    • 更改镜像源

      nvm node_mirror https://npm.taobao.org/mirrors/node/

      nvm npm_mirror https://npm.taobao.org/mirrors/npm/

    二、nvm的使用

    • 上面在提示文档中看着可能比较乱,我单独拿出一些命令进行解释

      命令 示例 功能
      nvm ls |nvm list 查看已经安装的node列表
      nvm list available 查看网络可安装的版本
      nvm arch 查看当前运行的node是32还是64
      nvm install <version> [arch] nvm install @14.15.1 64 安装指定版本和位数
      nvm use [arch] nvm use @14.15.1 64 切换指定版本的node,arch不写的时候,为你配置的默认位数
      nvm uninstall nvm uninstall @14.15.1 卸载指定版本
      nvm on 开启
      nvm off 关闭

      说明:<>的参数说明是必选参数[]中的参数是可选参数

  • 相关阅读:
    System.Web.HttpRequestValidationException——从客户端检测到危险的Request值
    SignalR 实现web浏览器客户端与服务端的推送功能
    MVC4项目中验证用户登录一个特性就搞定
    C# winform 上传文件到服务器
    解决memcached不能远程访问的问题
    MVC4验证用户登录特性实现方法
    IIS增加并发数
    IIS处理并发请求时出现的问题及解决
    jQuery使用ajax跨域获取数据
    jQuery调用WCF服务传递JSON对象
  • 原文地址:https://www.cnblogs.com/hongzhiguo/p/14207122.html
Copyright © 2011-2022 走看看