asdf-vm / asdf

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
https://asdf-vm.com/
MIT License
22.16k stars 790 forks source link

Cannot install nodejs versions #284

Closed mojochao closed 6 years ago

mojochao commented 6 years ago

Steps to reproduce

$ asdf plugin-add nodejs
$ asdf install nodejs 9.5.0
$ asdf global nodejs 9.5.0

Expected behavior

The package should be installed and set globally.

Actual behavior

$ asdf install nodejs 9.5.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4553    0  4553    0     0   6020      0 --:--:-- --:--:-- --:--:--  6014

$ asdf global nodejs 9.5.0
version 9.5.0 is not installed for nodejs
$ asdf current nodejs
No version set for nodejs

Environment

OS:

macOS High Sierra 10.13.3

asdf version:

v0.4.1

ranyefet commented 6 years ago

I also have the same issue

ipatch commented 6 years ago

@ranyefet @mojochao I believe these issues have been resolved. I have been running into issues with node recently as well since updating from 8.x to 9.x, I was having to manually delete the node and npm binaries / shims asdf was creating and manually reshimming them.

However, this then introduced another issue where the newly created node binary / shim would conflict with binaries such as which which no pun intended there in turn prevent which from finding other binaries, ie. git in my PATH

Long story short, I upgraded asdf to 0.4.2 today as I was previously running 0.4.1 then removed all versions of nodejs installed with asdf, then removed the nodejs plugin. Then, I readded the asdf nodejs plugin, and then added 9.4.0 and 9.5.0 of nodejs and everything appears to be working now 👌

I hope this helps.

cheers 🍻 Chris

mojochao commented 6 years ago

I upgraded to asdf v0.4.2 and tried your steps. I still fail in the same manner.

It doesn't even try to download anything, and immediately exits.

$ asdf --version
v0.4.2

$ asdf plugin-remove nodejs

$ asdf plugin-list
clojure
consul
elixir
elm
erlang
golang
haskell
idris
java
kops
kubecfg
kubectl
maven
minikube
mongodb
nomad
packer
postgres
rebar
redis
sbt
scala
terraform
vault

$ rm -rf ~/.asdf/installs/nodejs ~/.asdf/plugins/nodejs ~/.asdf/shims/nodejs

$ asdf plugin-add nodejs
Cloning into '/Users/agooch/.asdf/plugins/nodejs'...
remote: Counting objects: 288, done.
remote: Total 288 (delta 0), reused 0 (delta 0), pack-reused 288
Receiving objects: 100% (288/288), 53.98 KiB | 1.08 MiB/s, done.
Resolving deltas: 100% (132/132), done.

$ asdf plugin-list
clojure
consul
elixir
elm
erlang
golang
haskell
idris
java
kops
kubecfg
kubectl
maven
minikube
mongodb
nodejs
nomad
packer
postgres
rebar
redis
sbt
scala
terraform
vault

$ asdf install nodejs 9.4.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4208    0  4208    0     0   8106      0 --:--:-- --:--:-- --:--:--  8107

$ asdf current
clojure        1.9.0   (set by /Users/agooch/.tool-versions)
consul         1.0.6   (set by /Users/agooch/.tool-versions)
elixir         1.6.1   (set by /Users/agooch/.tool-versions)
elm            0.18.0  (set by /Users/agooch/.tool-versions)
erlang         20.2.2  (set by /Users/agooch/.tool-versions)
golang         1.9     (set by /Users/agooch/.tool-versions)
haskell        8.2.2   (set by /Users/agooch/.tool-versions)
idris          1.2.0   (set by /Users/agooch/.tool-versions)
java           9.0.4   (set by /Users/agooch/.tool-versions)
kops           1.8.1   (set by /Users/agooch/.tool-versions)
kubecfg        0.6.0   (set by /Users/agooch/.tool-versions)
kubectl        1.9.2   (set by /Users/agooch/.tool-versions)
maven          3.5.0   (set by /Users/agooch/.tool-versions)
minikube       0.25.0  (set by /Users/agooch/.tool-versions)
mongodb        3.5.1   (set by /Users/agooch/.tool-versions)
nodejs         No version set for nodejs
nomad          0.7.1   (set by /Users/agooch/.tool-versions)
packer         1.2.0   (set by /Users/agooch/.tool-versions)
postgres       10.1    (set by /Users/agooch/.tool-versions)
rebar          3.4.7   (set by /Users/agooch/.tool-versions)
redis          3.0.1   (set by /Users/agooch/.tool-versions)
sbt            0.13.9  (set by /Users/agooch/.tool-versions)
scala          2.12.4  (set by /Users/agooch/.tool-versions)
terraform      0.11.3  (set by /Users/agooch/.tool-versions)
vault          0.9.3   (set by /Users/agooch/.tool-versions)

$
ipatch commented 6 years ago

@mojochao

Don't remove nodejs by invoking rm with the following command

rm -rf ~/.asdf/installs/nodejs ~/.asdf/plugins/nodejs ~/.asdf/shims/nodejs

Instead remove all locally installed nodejs instances first

asdf uninstall nodejs 9.4.0

Then remove the plugin,

asdf plugin-remove nodejs

Then install the nodejs plugin with

asdf plugin-add nodejs

Then install a particular version of nodejs

asdf install nodejs 9.4.0

Then set the newly installed nodejs as the current version for asdf to use

asdf global nodejs 9.4.0

Glancing over what you posted above, you never set a global version of nodejs, so try running,

asdf global nodejs 9.4.0

fist, then test to make sure npm --version and node --version are working as intended.

cheers 🍻 Chris

mojochao commented 6 years ago

That wasn't it, but I did solve it.


$ brew install gnupg
$ bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring

After that, I was able to install.

Thanks for all the input!
jordan-brough commented 6 years ago

Docs for what @mojochao mentioned are here: https://github.com/asdf-vm/asdf-nodejs#requirements

(Current version: https://github.com/asdf-vm/asdf-nodejs/tree/9f3e93df#requirements)

garthgoldwater commented 4 years ago

Just ran into this problem today. I think that it would've taken me like ten seconds if the error message displayed on attempt to asdf install actually looked like an error message instead of line noise (You should install GnuPG... => ERROR: GnuPG required to install new version)

Stratus3D commented 4 years ago

@garthgoldwater please create an issue or PR on the nodejs plugin repo - https://github.com/asdf-vm/asdf-nodejs