From 26186e227a442982ae9a450156e0a88505621028 Mon Sep 17 00:00:00 2001 From: Lianyi Han Date: Tue, 6 Jun 2017 12:50:15 -0400 Subject: [PATCH] fix the issue as reported in https://github.com/hakobera/nvmw/issues/75 fix the node URL issue. --- get_npm.js | 8 ++++---- nvmw.bat | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/get_npm.js b/get_npm.js index b4deca4..92a2632 100644 --- a/get_npm.js +++ b/get_npm.js @@ -3,11 +3,11 @@ var util = require('util'), path = require('path'), wget = require('./wget'); -var NPM_PKG_JSON_URL = 'https://raw.githubusercontent.com/%s/%s/deps/npm/package.json'; -// https://github.com/npm/npm/tags +var NPM_PKG_JSON_URL = 'https://raw.githubusercontent.com/%s/%s/deps/npm/package.json'; +// https://github.com/npm/npm/tags var NVMW_NPM_MIRROR = process.env.NVMW_NPM_MIRROR || 'https://github.com/npm/npm/archive'; var BASE_URL = NVMW_NPM_MIRROR + '/v%s.zip'; - + var targetDir = process.argv[2]; var versions = process.argv[3].split('/'); var binType = versions[0]; @@ -41,7 +41,7 @@ if (binType === 'iojs') { downloadNpmZip(npmVersion); }); } else { - var pkgUri = util.format(NPM_PKG_JSON_URL, 'joyent/node', + var pkgUri = util.format(NPM_PKG_JSON_URL, 'nodejs/node', binVersion === 'latest' ? 'master' : binVersion); wget(pkgUri, function (filename, pkg) { if (filename === null) { diff --git a/nvmw.bat b/nvmw.bat index cce9b6a..da7aaab 100644 --- a/nvmw.bat +++ b/nvmw.bat @@ -132,9 +132,9 @@ if %NODE_TYPE% == iojs ( ) ) else ( if %ARCH% == x32 ( - set NODE_EXE_URL=%NVMW_NODEJS_ORG_MIRROR%/%NODE_VERSION%/node.exe + set NODE_EXE_URL=%NVMW_NODEJS_ORG_MIRROR%/%NODE_VERSION%/win-x86/node.exe ) else ( - set NODE_EXE_URL=%NVMW_NODEJS_ORG_MIRROR%/%NODE_VERSION%/x64/node.exe + set NODE_EXE_URL=%NVMW_NODEJS_ORG_MIRROR%/%NODE_VERSION%/win-x64/node.exe ) )