Skip to content
This repository has been archived by the owner on Dec 24, 2018. It is now read-only.

Add io.js support and download npm from github #36

Merged
merged 6 commits into from
Jan 22, 2015

Conversation

fengmk2
Copy link
Contributor

@fengmk2 fengmk2 commented Jan 17, 2015

Install iojs just like nvm does, nvm-sh/nvm#590

nvmw install iojs
nvmw install iojs-1.0.2
nvmw use iojs-1.0.2

Fixes #30 #27

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';

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Owner

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

@hakobera
Copy link
Owner

@fengmk2 Verrrrrry Cool 👍

But current branch is not working on my environment.

  • npm install failed, I added comment above (and you realized that already).
  • uninstall command not working, because NODE_TYPE is missing in NODE_HOME.

@@ -75,27 +81,44 @@ exit /b 0
:install
setlocal

set NODE_TYPE=node
Copy link
Contributor Author

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.

Copy link
Owner

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.

Copy link
Contributor Author

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

Copy link
Owner

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.

Copy link
Contributor Author

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\

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, move v* node\ is not working for me.

2015-01-20 15 36 32

Copy link
Contributor Author

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
@fengmk2
Copy link
Contributor Author

fengmk2 commented Jan 18, 2015

@hakobera all fixed. You can try again.

@fengmk2
Copy link
Contributor Author

fengmk2 commented Jan 18, 2015

image

@fengmk2
Copy link
Contributor Author

fengmk2 commented Jan 18, 2015

image

@@ -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"
Copy link
Contributor Author

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

@fengmk2
Copy link
Contributor Author

fengmk2 commented Jan 18, 2015

image

set NODE_VERSION=%%b
)
)

if not %NODE_VERSION:~0,1% == v (

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l for latest?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@fengmk2
Copy link
Contributor Author

fengmk2 commented Jan 20, 2015

nvm changed nvm-sh/nvm#616

in general, a specific io.js version can be referenced with the "iojs-" prefix. If node were to ever release a v1.0.0, v1.0.0 would refer to node, and iojs-v1.0.0 would refer to io.js. In the near future, node-v1.0.0 will also refer to node unambiguously.

@@ -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
Copy link
Contributor Author

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.

@shaoshuai0102
Copy link

excellent work

@am11
Copy link

am11 commented Jan 20, 2015

👍 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%"
Copy link
Contributor Author

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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hakobera
Copy link
Owner

@fengmk2 This is really awesome work!

hakobera added a commit that referenced this pull request Jan 22, 2015
Add io.js support and download npm from github
@hakobera hakobera merged commit 2c20d4c into hakobera:master Jan 22, 2015
@fengmk2 fengmk2 deleted the iojs-support branch February 14, 2015 13:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants