nvmw
nvmw copied to clipboard
In China, download 404 Not Found
In China,taobao's mirrors is http://npm.taobao.org/mirrors/node/v4.1.1/win-x64/, path is win-x64 not x64.
Same here :)
same problem with v4.4.2 x64
When I attempt to install this version of node, I get a 404:
D:\VS> nvmw install v5.1.1
Start installing node/v5.1.1 (x64) to C:\Users\ccraig\.nvmw\v5.1.1
Download from https://nodejs.org/dist/v5.1.1/x64/node.exe, and save it as C:\Users\ccraig\.nvmw\v5.1.1\node.exe
404 Not Found
Download C:\Users\ccraig\.nvmw\v5.1.1\node.exe from https://nodejs.org/dist/v5.1.1/x64/node.exe failed
This version exists at https://nodejs.org/dist/v5.1.1/win-x64/node.exe
rather than at https://nodejs.org/dist/v5.1.1/x64/node.exe
+1
+1
+1
+1
+1
+1
+1
For that matter, I have modified the some source code, nvmw can work normally. The following is the place where I modified.
1、nvmw.bat:The line 137 win-x64 instead of x64
2、fget.js:The line 48 ServerXMLHTTP instead of XMLHTTP
3、get_npm.js:in line 6 var NPM_PKG_JSON_URL = 'http://npm.taobao.org/mirrors/node/index.json';
in line 44 var pkgUri = NPM_PKG_JSON_URL;
in line 51 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); } }
In china,modify the nvmw.bat, find this text
if %ARCH% == x32 ( set NODE_EXE_URL=%NVMW_NODEJS_ORG_MIRROR%/%NODE_VERSION%/node.exe ) else ( set NODE_EXE_URL=%NVMW_NODEJS_ORG_MIRROR%/%NODE_VERSION%/x64/node.exe ) )
and modify
set NODE_EXE_URL=%NVMW_NODEJS_ORG_MIRROR%/%NODE_VERSION%/x64/node.exe
to
set NODE_EXE_URL=%NVMW_NODEJS_ORG_MIRROR%/%NODE_VERSION%/win-x64/node.exe
works for me