下载安装
下载地址 github
- 下载
git clone git://github.com/hakobera/nvmw.git "%HOMEDRIVE%%HOMEPATH%\.nvmw"
- 设置环境变量
git clone git://github.com/hakobera/nvmw.git "%HOMEDRIVE%%HOMEPATH%\.nvmw"
修改文件
1.fget.js文件47行,XMLHTTP 改为ServerXMLHTTP
2.nvmw.bat文件137行,x64改为win-x64
3.nvmw.bat文件22行
if not defined NVMW_NODEJS_ORG_MIRROR (
set "NVMW_NODEJS_ORG_MIRROR=https://nodejs.org/dist"
)
if not defined NVMW_IOJS_ORG_MIRROR (
set "NVMW_IOJS_ORG_MIRROR=https://iojs.org/dist"
)
-------------------------------改为-------------------------------------------
if not defined NVMW_NODEJS_ORG_MIRROR (
set "NVMW_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node"
)
if not defined NVMW_IOJS_ORG_MIRROR (
set "NVMW_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojs"
)
4.get_npm.js文件8行
var NVMW_NPM_MIRROR = process.env.NVMW_NPM_MIRROR || 'https://github.com/npm/npm/archive';
----------------------------------改为--------------------------------------
var NVMW_NPM_MIRROR = process.env.NVMW_NPM_MIRROR || 'http://npm.taobao.org/mirrors/npm';
5.get_npm.js文件 44行-51行改为为
var pkgUri = "https://npm.taobao.org/mirrors/node/index.json";
wget(pkgUri, function (filename, pkg) {
if (filename === null) {
return noNpmAndExit();
}
var _pkg = JSON.parse(pkg);
for(var i = 0,n=_pkg.length;i<n;i++){
var obj = _pkg[i];
if(obj.version == binVersion){
downloadNpmZip(obj.npm);
}
}
})
使用说明
Usage:
nvmw help Show this message
nvmw install [version] Download and install a [version]
nvmw uninstall [version] Uninstall a [version]
nvmw use [version] Modify PATH to use [version]
nvmw ls List installed versions
Example:
nvmw install v0.6.0 Install a specific version number
nvmw use v0.6.0 Use the specific version
nvmw install iojs Install the latest version of io.js
nvmw install iojs-v1.0.2 Install a specific version number of io.js
nvmw use iojs-v1.0.2 Use the specific version of io.js