nodist - node多版本管理管理及代理設(shè)置【windows】

訪問Nodist主頁,下載安裝包,安裝好軟件。注:如果電腦之前安裝了Node,安裝Nodist之前需要卸載掉Node;

淘寶鏡像地址:
查看所有可用的node版本地址
查看所有可用的npm版本地址
查看所有可用的iojs版本地址

更換淘寶鏡像,加速node下載。

1、添加環(huán)境變量:

NODIST_NODE_MIRROR                值:https://npm.taobao.org/mirrors/node
NODIST_IOJS_MIRROR                值:https://npm.taobao.org/mirrors/iojs

2、npm加速。打開命令行窗口,輸入命令:

npm config set registry https://registry.npm.taobao.org 

3、常用命令:

 nodist //查看當(dāng)前安裝了的node版本列表
 nodist 4.4.6 //設(shè)置全局node的版本,如果該版本不存在,會(huì)先下載
 nodist + 4.4.6 //檢查該版本有沒有安裝,如果沒有,會(huì)進(jìn)行下載
 nodist -4.4.6 //移除某個(gè)版本

 nodist npm list  // 查看所有已安裝的npm版本
 nodist npm match  // 切換到匹配當(dāng)前node版本的npm版本(沒有則下載)
 nodist npm 3.10.5  // 安裝npm 3.10.5版本

使用說明

Usage:

nodist                          List all installed node versions.
nodist list
nodist ls

nodist dist                     List all available node versions.
nodist ds

nodist add <version>            Download the specified node version.
nodist + <version>

nodist rm <version>             Uninstall the specified node version.
nodist - <version>

nodist <version>                Use the specified node version globally
nodist global <version>         (downloads the executable, if necessary).

nodist local <version>          Use <version> in this directory and its subdirectories.
                                (will add a ./node-version file)

nodist use <version>            Use <version> in the current environment only
nodist env <version>            (usually the current terminal window).

nodist run <version> -- <args..>    Run <args> with the specified node version
nodist r <version> -- <args..>      (downloads the executable, if necessary).

nodist bin <version>            Get the path to the specified node executable
                                (downloads the executable, if necessary).

nodist path <version>           Get the path to the specified node version directory
                                (downloads the executable, if necessary).

nodist npm <version>            Activate the specified npm version
                                (downloads it if necessary)

nodist npm match                Activate the npm version matching the active
                                node version.

nodist --help                   Display this help

nodist -v                       Display nodist version

Examples:

nodist 0.8.1                    Use node v0.8.1 globally

nodist v0.5.10                  Use node v0.5.10 globally

nodist - 0.5.10                 Uninstall node v0.5.10

nodist r v0.8.1 -- foo.js -s    Run `foo.js -s` with node v0.8.1, regardless
                                of the global version
                                
nodist latest                   Use the latest available node version globally
                                (downloads the executable, if necessary).
                               
nodist + all                    Installs *all* available node versions.
                                (Get yourself a cuppa in the meantime...)

Env vars:

NODIST_X64                      Will always use the 64bit versions if set to '1'

HTTP_PROXY                      Will use the Url and port specified as a proxy
                                (e.g. http://myproxy.com:8213 )

NODIST_NODE_MIRROR              Set an alternative URL to fetch the node executables
                                from (e.g. http://mymirror.com/dist)

NODIST_IOJS_MIRROR              Set an alternative URL to fetch io.js exectuables
                                from.
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 前言 目前主流的node版本管理工具有兩種,nvm和n。兩者差異挺大的,具體分析可以參考一下淘寶FED團(tuán)隊(duì)的一篇文...
    一個(gè)廢人閱讀 6,659評(píng)論 0 3
  • npm是什么 NPM的全稱是Node Package Manager,是隨同NodeJS一起安裝的包管理和分發(fā)工具...
    build1024閱讀 8,127評(píng)論 0 9
  • NPM 使用介紹 NPM是隨同NodeJS一起安裝的包管理工具,能解決NodeJS代碼部署上的很多問題,常見的使用...
    yyshang閱讀 445評(píng)論 0 1
  • nvm最新的下載地址 Node版本管理器--nvm,可以運(yùn)行在多種操作系統(tǒng)上。nvm for windows 是使...
    weiqinl閱讀 7,657評(píng)論 0 6
  • 到底該說點(diǎn)什么呢,讓我再想想。
    無尾犬1987閱讀 290評(píng)論 0 0

友情鏈接更多精彩內(nèi)容