美文网首页资料
nodist - node多版本管理管理及代理设置【window

nodist - node多版本管理管理及代理设置【window

作者: 行走的棉花糖 | 来源:发表于2016-10-10 14:12 被阅读0次

访问Nodist主页,下载安装包,安装好软件。注:如果电脑之前安装了Node,安装Nodist之前需要卸载掉Node;

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

更换淘宝镜像,加速node下载。

1、添加环境变量:

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 //查看当前安装了的node版本列表
 nodist 4.4.6 //设置全局node的版本,如果该版本不存在,会先下载
 nodist + 4.4.6 //检查该版本有没有安装,如果没有,会进行下载
 nodist -4.4.6 //移除某个版本

 nodist npm list  // 查看所有已安装的npm版本
 nodist npm match  // 切换到匹配当前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.

相关文章

网友评论

    本文标题:nodist - node多版本管理管理及代理设置【window

    本文链接:https://www.haomeiwen.com/subject/mzzmyttx.html