asdf-nodejs: Unable to import gpg keys for node on macOS

Just set up a new dev Mac and trying to install node, when trying to add the gpg keys I’m getting the following errors.

bash -c '${ASDF_DATA_DIR:=$HOME/.asdf}/plugins/nodejs/bin/import-release-team-keyring'

gpg: keybox '/Users/engarcia/.gnupg/asdf-nodejs.gpg' created
gpg: keyserver receive failed: Network is unreachable
gpg: keyserver receive failed: No keyserver available
...
gpg: keyserver receive failed: Network is unreachable
gpg: keyserver receive failed: No keyserver available

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 10
  • Comments: 19 (6 by maintainers)

Commits related to this issue

Most upvoted comments

for what it’s worth, the solution suggested here (https://github.com/asdf-vm/asdf-nodejs/issues/192#issuecomment-786698681) did not work for me on its own:

$ echo "standard-resolver" >  ~/.gnupg/dirmngr.conf

I had to additionally do:

sudo pkill dirmngr

now keys are found and imported.

I am on:

  • macOS Big Sur v11.2.3
  • gpg (GnuPG) 2.2.27
  • asdf v0.8.0-c6145d0

I had this issue today and created the file ~/.gnupg/dirmngr.conf and added the following line:

standard-resolver

And it fixed it for me. Not sure if this needs to be in the docs for asdf-nodejs (or other asdf tools)

I was also having this issue on MacOS Big Sur 11.4 (Intel) and the standard-resolver did fix it after a few attempts.

Agree with @Jikodis 💯 that this should be added to the docs or fixed.

Can confirm this issue is happening on MacOS Big Sur 11.3.1 (20E241). The standard-resolver in dirmngr.conf fixed the issue as well. Interesting to note is that two of my fellow devs were running MacOS Catalina and did not get this error. One of them tried the same same installation process between Big Sur and Catalina, and that provided extra verification that it was indeed a Big Sur specific issue.

I would not have found this Github suggested solution were it not for a fellow dev sending it my way. Searching the error message online brings up a myriad of suggested resolutions that send the dev down a rabbit hole of trying many different potential resolutions that end up not working. Adding this to the readme, docs somewhere, part of the installation, or fixing it in the code base for MacOS Big Sur would save others a lot of trouble.

@ruprict i ended up doing the same thing and it worked for me as well. Forgot to come back here and post an update.

Yes, asdf-nodejs doesn’t rely on keyservers anymore

Upgrading to the latest asdf-nodejs solved this for me today:

$ asdf install nodejs lts
Installing alias lts as 16.14.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4035    0  4035    0     0  28255      0 --:--:-- --:--:-- --:--:-- 30111
gpg: keyserver receive failed: Try again later
^C
gpg: signal Interrupt caught ... exiting

received sigint, cleaning upCould not install version 16.14.0

received sigint, cleaning up%
$ asdf plugin update nodejs
Updating nodejs to master
From https://github.com/asdf-vm/asdf-nodejs
   cb61e3d..ed34355  master     -> master
   cb61e3d..ed34355  master     -> origin/master
Already on 'master'
Your branch is up to date with 'origin/master'.
$ asdf install nodejs lts
Installing alias lts as 16.14.0
Cloning node-build...
node-build: definition not found: 16.14.0
Could not install version 16.14.0
$ asdf install nodejs 16.13.2
Trying to update node-build... ok
Downloading node-v16.13.2-darwin-x64.tar.gz...
-> https://nodejs.org/dist/v16.13.2/node-v16.13.2-darwin-x64.tar.gz
Installing node-v16.13.2-darwin-x64...
Installed node-v16.13.2-darwin-x64 to /Users/vs/.asdf/installs/nodejs/16.13.2