訪問(wèn)Nodist主頁(yè)掺出,下載安裝包徽千,安裝好軟件。注:如果電腦之前安裝了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加速。打開(kāi)命令行窗口慎菲,輸入命令:
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 //檢查該版本有沒(méi)有安裝棠众,如果沒(méi)有,會(huì)進(jìn)行下載
nodist -4.4.6 //移除某個(gè)版本
nodist npm list // 查看所有已安裝的npm版本
nodist npm match // 切換到匹配當(dāng)前node版本的npm版本(沒(méi)有則下載)
nodist npm 3.10.5 // 安裝npm 3.10.5版本
使用說(shuō)明
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.