Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install nightly #43

Open
FallingSnow opened this issue Mar 19, 2018 · 8 comments
Open

Unable to install nightly #43

FallingSnow opened this issue Mar 19, 2018 · 8 comments

Comments

@FallingSnow
Copy link

$ nvm install nightly         
Version 'node' not found - try `nvm ls-remote` to browse available versions.
Clearing mirror cache...
Done!

Let me know if you need any more information.

@lukechilds
Copy link
Owner

Thanks for reporting.

I'm not quite sure why this has broken, possibly the format of https://nodejs.org/download/nightly/ has changed, although that seems unlikely.

Or possibly nvm has changed the way it parses versions, as it seems to be interpreting the nightly versions as iojs.

$ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm install node
Version 'node' not found - try `nvm ls-remote` to browse available versions.

$ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm ls-remote
    iojs-v1.0.0
    iojs-v1.0.1
    iojs-v1.0.2
    iojs-v1.0.3
    iojs-v1.0.4
    iojs-v1.1.0
    iojs-v1.2.0
    iojs-v1.3.0
    iojs-v1.4.1
    ...
    iojs-v3.3.1

@FallingSnow
Copy link
Author

I was able to install nightly via v8-canary: NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/v8-canary nvm install node.

@lukechilds
Copy link
Owner

lukechilds commented Mar 22, 2018

Hmmnn, seems to just be that by chance it's parsing a couple of the v8-canary listings as node instead of iojs:

$ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/v8-canary/ nvm ls-remote
v9.0.0-v8-canary201710301f8f3dcf36
v10.0.0-v8-canary20180321f7efae222a
    iojs-v1.0.0
    iojs-v1.0.1
    iojs-v1.0.2
    ...
    iojs-v3.3.1

@lukechilds
Copy link
Owner

Unfortunately I don't really have the time to look into this further right now. PRs welcome!

I think the best solution would either be to remove this feature completely (it was always a bit of a hack), or add our own version parsing that properly detects canary/nightly/rc versions.

The latter would need to be done very carefully to avoid any breakage and not mess things up with nvm. It should probably be submitted as a PR to nvm rather than to zsh-nvm if the maintainers want it.

@FallingSnow
Copy link
Author

I agree. I believe this is a feature that should be in nvm, not zsh-nvm. Unfortunately I doesn't seem like a priority to them.

@cswl
Copy link

cswl commented Apr 8, 2018

@lukechilds
I stopped messing with nightly node... so I didnt notice this yet...

I can write our own nightly/rc installer which parses the stuff..
which uses absolute versions and doesnt interfere with stable nvm installs...

I will get around to writing this tonight..

@lukechilds
Copy link
Owner

That would be amazing, I think it's a fairly big job though.

If you're serious about doing this it might be worth contributing it upstream, directly to nvm. Then everyone can benefit, not just users of zsh-nvm. It would probably be worth creating an issue there first and letting them know what you're planning, just to make sure they definitely want it.

@cswl
Copy link

cswl commented Apr 8, 2018

So I took a look at why it's parsing nightly versions as iojs...

+nvm_ls_remote_index_tab:91> VERSIONS='' 
+nvm_ls_remote_index_tab:104> [ -z '' ']'
+nvm_ls_remote_index_tab:105> nvm_echo N/A
+nvm_echo:1> printf '%s\n' N/A
+nvm_ls_remote_index_tab:3> [ 3 -lt 3 ']'
+nvm_ls_remote_index_tab:8> local FLAVOR
+nvm_ls_remote_index_tab:9> FLAVOR=iojs 

It fails to parse VERSIONS and return N/A.. https://github.com/creationix/nvm/blob/bc87d3dd1c380298be2d624331bc83578255f5f9/nvm.sh#L1083

The checking logic in https://github.com/creationix/nvm/blob/bc87d3dd1c380298be2d624331bc83578255f5f9/nvm.sh#L512
Causes it to get detected as iojs..

Unfortunately the parsing logic is written in awk which I don't have much knowledge..
I will need to learn it before I can work in this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants