From 9fb369337d063fc3dcdbe36f8474f52256394d5c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Aug 2014 16:47:38 +0530 Subject: [PATCH] installing npm from github --- get_npm.js | 3 +-- nvmw.bat | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/get_npm.js b/get_npm.js index de71ac9..d6b8be8 100644 --- a/get_npm.js +++ b/get_npm.js @@ -4,8 +4,7 @@ var util = require('util'), wget = require('./wget'); var NPM_PKG_JSON_URL = 'https://raw.githubusercontent.com/joyent/node/%s/deps/npm/package.json'; -var NVMW_NODEJS_ORG_MIRROR = process.env.NVMW_NODEJS_ORG_MIRROR || 'http://nodejs.org/dist'; -var BASE_URL = NVMW_NODEJS_ORG_MIRROR + '/npm/npm-%s.zip'; +var BASE_URL = 'https://github.com/npm/npm/archive/v%s.zip'; var targetDir = process.argv[2]; var nodeVersion = process.argv[3]; diff --git a/nvmw.bat b/nvmw.bat index afd18d7..d6d8a88 100644 --- a/nvmw.bat +++ b/nvmw.bat @@ -105,7 +105,9 @@ if not exist "%NODE_EXE_FILE%" ( set "CD_ORG=%CD%" cd "%NODE_HOME%" cscript "%NVMW_HOME%\unzip.js" "%NPM_ZIP_FILE%" "%NODE_HOME%" - cd "%CD_ORG%" + mkdir %NODE_HOME%\node_modules + move npm-* %NODE_HOME%\node_modules\npm + copy %NODE_HOME%\node_modules\npm\bin\npm.cmd %NODE_HOME%\npm.cmd if not exist "%NODE_HOME%\npm.cmd" goto install_error echo npm %NPM_VERSION% install ok