windows 安裝nvm步驟(shi'yongnvm-windows管理node版本):

 

 

瞎幾把前言:mac上能夠用n來管理node版本,私覺得n很好用。家裏的win7臺式機一直沒有安裝過任何管理工具,今天來給家裏電腦安裝一下nvw-windows,一個用於windows系統的node版本工具。node

 

電腦系統:系統win7 64位:git

 

nvw-windows的官網:https://github.com/coreybutler/nvm-windows/releasesgithub

 

1、安裝步驟:

(一)下載:

首先從官網下載安裝包 https://github.com/coreybutler/nvm-windows/releases,我下了一個setup版本的,下下來是個壓縮包,解壓后里面是一個exe,安裝方式就如同一個常見的exe安裝包,雙擊運行便可:web

 

 

(一)安裝:

1.雙擊exe開始安裝:npm

 

2.下面這一步:配置nvm的安裝位置,任意一個你喜歡的位置均可以。windows

 

3.設置node的symlink文件夾位置。這個文件夾的名字必定不能含有中文或空格!ide

 

 

 

4.若是在安裝nvm以前,電腦上就已經安裝有node的,會看到以下圖,詢問你是否用nvm管理已經存在的node版本。必定要選‘是’,這個彈窗可能會出現好幾回,都點是。工具

5.安裝完成。看到以下圖:url

 

 

(二)使用nvm:

1.檢查nvm是否安裝成功:

使用管理員權限打開一個命令行。輸入nvm v,會顯示nvm的版本號,有則表示安裝成功。spa

2. nvm各命令用法:(黏自官網)

  • nvm arch [32|64]: Show if node is running in 32 or 64 bit mode. Specify 32 or 64 to override the default architecture.
  • 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.
  • nvm list [available]: List the node.js installations. Type available at the end to show a list of versions available for download.
  • nvm on: Enable node.js version management.
  • nvm off: Disable node.js version management (does not uninstall anything).
  • 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 uninstall <version>: Uninstall 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 based on the value supplied to <arch>. For information about using use in a specific directory (or using .nvmrc), please refer to issue #16.
  • 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.
  • nvm node_mirror <node_mirror_url>: Set the node mirror.People in China can use https://npm.taobao.org/mirrors/node/
  • nvm npm_mirror <npm_mirror_url>: Set the npm mirror.People in China can use https://npm.taobao.org/mirrors/npm/

 

3. nvm經常使用命令(我的對上述命令中的經常使用命令的一個總結和翻譯):

  •  安裝指定版本的node: nvm install 版本號

    好比安裝8.9.3:

nvm install 8.9.3
  •  使用指定版本的node: nvm use 版本號

    好比使用8.9.3:

nvm use 8.9.3
  •  使用淘寶node鏡像:nvm node_mirror
  • 使用淘寶npm鏡像:nvm npm_mirror
  • 查看當前電腦上已經安裝的所有node版本,正在使用中的版本號前有個星號:
nvm ls
  • 查看可用的(可下載的)所有node版本:
nvm ls available

2、NVM使用中常見錯誤:

(一)、nvm use  出現exit status 1

相關文章
相關標籤/搜索