zsh-nvm
zsh-nvm copied to clipboard
Use absolute version to install nightly and rc
Tested to install latest nightly. The version_list code is copy pasta from nvm sauce with slight modification However I couldnt copy pasta the nvm_download function.. which has lot of internal stuffs. So, I just used curl for now.
EDIT: Rebased to update commit message.
$ nvm install nightly
Latest nightly: v10.0.0-nightly20171121a95d88c881
Downloading and installing node v10.0.0-nightly20171121a95d88c881...
Local cache found: $NVM_DIR/.cache/bin/node-v10.0.0-nightly20171121a95d88c881-linux-x64/node-v10.0.0-nightly20171121a95d88c881-linux-x64.tar.xz
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v10.0.0-nightly20171121a95d88c881-linux-x64/node-v10.0.0-nightly20171121a95d88c881-linux-x64.tar.xz
npm WARN npm npm does not support Node.js v10.0.0-nightly20171121a95d88c881
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
Now using node v10.0.0-nightly20171121a95d88c881 (npm v5.5.1)
nightly -> v10.0.0-nightly20171121a95d88c881
Clearing mirror cache...
Done!
Alias seems to be fine too..
nvm list
v9.2.0
-> v10.0.0-nightly20171121a95d88c881
default -> stable (-> v9.2.0)
nightly -> v10.0.0-nightly20171121a95d88c881
node -> v9.2.0
stable -> v9.2.0
Thanks for working on this, you can piggy back on existing nvm
code to list the remote versions by setting NVM_NODEJS_ORG_MIRROR
and running nvm ls
e.g:
$ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm ls-remote
v0.10.41-nightly20151203036580393d
v0.10.42-nightly20160128b125512a5c
...
v9.1.1-nightly201711075f5ef4226e
v10.0.0-nightly20171126bb4462681c
Alright.. I will work on this tonight.. and rebase the PR
One issue I noticed is that, nvm ls-remote
shows human -readable output... so if you have the latest nightly currently active it shows
-> v10.0.0-nightly20171126bb4462681c
So I need to handle that in parsing logic too.. :\
@lukechilds I felt copying the functions from nvm
was easier.. than handling different cases for ls-remote
.
Tested and working.
I've re-used nvm functions wherever possible to keep the codebase to minimum and reduce code duplication.
It should be fairly simple to parse nvm ls-remote
output, you just need to check for the first occurrence of v
and then capture that and all chars after it until you hit a whitespace char.
@lukechilds I've used nvm ls-remote
and pattern matching version..
However, I'm getting this error when I have already installed the latest nightly..
Latest nightly: v10.0.0-nightly201711274ca4db0d4c.
grep: Unmatched [ or [^
awk: cmd. line:3: (FILENAME=- FNR=1) fatal: Unmatched [, [^, [:, [., or [=: /v10.0.0-nightly201711274ca4db0d4c/
grep: Unmatched [ or [^
awk: cmd. line:3: (FILENAME=- FNR=1) fatal: Unmatched [, [^, [:, [., or [=: /v10.0.0-nightly201711274ca4db0d4c/
Version 'v10.0.0-nightly201711274ca4db0d4c' not found - try `nvm ls-remote` to browse available versions.
Clearing mirror cache...
Done!
Installing the nighltly from scratch works fine.. I guess we could check whether the installed version is latest by ourselves instead of calling nvm install
..
Sigh..
Does this definitely resolve the problem for you? I still get the nightly aliases:
$ nvm install nightly
Latest nightly: v10.0.0-nightly20171130701dc9a86e.
Downloading and installing node v10.0.0-nightly20171130701dc9a86e...
Local cache found: $NVM_DIR/.cache/bin/node-v10.0.0-nightly20171130701dc9a86e-darwin-x64/node-v10.0.0-nightly20171130701dc9a86e-darwin-x64.tar.xz
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v10.0.0-nightly20171130701dc9a86e-darwin-x64/node-v10.0.0-nightly20171130701dc9a86e-darwin-x64.tar.xz
npm WARN npm npm does not support Node.js v10.0.0-nightly20171130701dc9a86e
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
Now using node v10.0.0-nightly20171130701dc9a86e (npm v5.5.1)
nightly -> v10.0.0-nightly20171130701dc9a86e
Clearing mirror cache...
Done!
$ nvm ls
v4.8.4
v5.12.0
v6.11.3
v8.4.0
v8.5.0
v8.6.0
v9.2.0
-> v10.0.0-nightly20171130701dc9a86e
system
default -> node (-> v10.0.0-nightly20171130701dc9a86e)
nightly -> v10.0.0-nightly20171130701dc9a86e
node -> stable (-> v10.0.0-nightly20171130701dc9a86e) (default)
stable -> 10.0 (-> v10.0.0-nightly20171130701dc9a86e) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
lts/argon -> v4.8.6 (-> N/A)
lts/boron -> v6.12.0 (-> N/A)
lts/carbon -> v8.9.1 (-> N/A)
You have to manually clear the alias if you once used the older hack.
nvm ls
v4.8.6
v6.12.0
v8.9.1
-> v9.2.0
v10.0.0-nightly201711274ca4db0d4c
default -> stable (-> v9.2.0)
nightly -> v10.0.0-nightly201711274ca4db0d4c
node -> v9.2.0
stable -> v9.2.0
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.9.1)
lts/argon -> v4.8.6
lts/boron -> v6.12.0
lts/carbon -> v8.9.1