-
Notifications
You must be signed in to change notification settings - Fork 179
Add io.js support and download npm from github #36
Conversation
var BASE_URL = NVMW_NODEJS_ORG_MIRROR + '/npm/npm-%s.zip'; | ||
// 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'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Download npm from github by default. And also can download npm from a mirror site like https://npm.taobao.org/mirrors/npm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
archive npm missing npm.cmd
, I need to auto create npm.cmd
to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto create npm.cmd
script is include in deepak1556@9fb3693
@fengmk2 Verrrrrry Cool 👍 But current branch is not working on my environment.
|
@@ -75,27 +81,44 @@ exit /b 0 | |||
:install | |||
setlocal | |||
|
|||
set NODE_TYPE=node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hakobera should we keep NODE_TYPE
be empty string when install node.js? This can keep compatible with the old way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fengmk2 If you can do it, I think keep compatibility is good for current users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After really use in two days, keep all version into special folder look better.
e.g.: node/v0.11.10
better than v0.11.10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but this is breaking change. So we should add document about this change and how to migration from old nvmw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about migration scripts:
mkdir node
move v* node\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to create a upgrade.bat
scripts
Install iojs just like nvm does, nvm-sh/nvm#590 nvmw install iojs/1.0.2 nvmw use iojs/1.0.2 Fixes hakobera#30 hakobera#27
@hakobera all fixed. You can try again. |
@@ -103,9 +126,13 @@ if not exist "%NODE_EXE_FILE%" ( | |||
echo Download %NODE_EXE_FILE% from %NODE_EXE_URL% failed | |||
goto install_error | |||
) else ( | |||
if %NODE_TYPE% == iojs ( | |||
copy "%NVMW_HOME%\node.cmd" "%NODE_HOME%\node.cmd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep bin name as iojs.exe and add node.cmd alias to iojs.exe
set NODE_VERSION=%%b | ||
) | ||
) | ||
|
||
if not %NODE_VERSION:~0,1% == v ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fengmk2 shouldnt this be if not %NODE_VERSION:~0,1% == v if not %NODE_VERSION:~0,1% == l
. if there is a numeric condition that would be better. Otherwise works awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l
for latest
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
nvm changed nvm-sh/nvm#616
|
@@ -34,17 +34,28 @@ Usage | |||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As same as nvm now.
excellent work |
👍 and thanks for this @fengmk2! |
|
||
set "NODE_HOME=%NVMW_HOME%%NODE_VERSION%" | ||
if %NODE_TYPE% == iojs ( | ||
set "NODE_HOME=%NVMW_HOME%%NODE_TYPE%\%NODE_VERSION%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hakobera I change to save node version as before to compatibility now. If there no other problems, this pr can merge now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@fengmk2 This is really awesome work! |
Add io.js support and download npm from github
Install iojs just like nvm does, nvm-sh/nvm#590
Fixes #30 #27