nvm安装(windows篇)

如果你想长期做node开发,或者想快速更新node版本,或者想快速切换node版本,那就使用nvm来安装你的node开发环境,保持系统的干净。

nvm下载

多版本nodejs管理工具nvm for windows:-->github地址<–

nvm命令

在控制台输入nvm,我们看到了

Running version 1.1.5.
Usage:
nvm arch : Show if node is running in 32 or 64 bit mode.
nvm install [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.
nvm list [available] : List the node.js installations. Type “available” at the end to see what can be installed. Aliased as ls.
nvm on : Enable node.js version management.
nvm off : Disable node.js version management.
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 node_mirror [url] : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
nvm npm_mirror [url] : Set the npm mirror. Defaults to https://github.com/npm/npm/archive/. Leave [url] blank to default url.
nvm uninstall : The version must be a specific version.
nvm use [version] [arch] : Switch to use the specified version. Optionally specify 32/64bit architecture. nvm use will continue using the selected version, but switch to 32/64 bit mode.
nvm root [path] : Set the directory where nvm should store different versions of node.js.If is not set, the current root will be displayed.
nvm version : Displays the current running version of nvm for Windows. Aliased as v.

设置nvm国内镜像

nvm默认的下载地址是http://nodejs.org/dist/,这是国外的服务器,在国内下载速度很慢。

1
2
nvm node_mirror https://npm.taobao.org/mirrors/node/
nvm npm_mirror https://npm.taobao.org/mirrors/npm/

使用 cnpm 加速 npm

1
2
3
npm config rm proxy
npm config rm https-proxy
npm config set registry https://registry.npm.taobao.org

git代理设置方法解决

1
2
3
4
5
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy

nvm安装(windows篇)
http://example.com/2017-07-17 nvm安装(windows/
作者
csorz
发布于
2017年7月17日
许可协议