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 node >= 18.12.0 versions #344

Open
jtlimo opened this issue Mar 16, 2023 · 42 comments
Open

Unable to install node >= 18.12.0 versions #344

jtlimo opened this issue Mar 16, 2023 · 42 comments

Comments

@jtlimo
Copy link

jtlimo commented Mar 16, 2023

I'm using a MacOS M1 and trying to install the 18.12.0 version, but instead I receive an error message that suggests to use the flag --compile; I tried using the flag, but the error continues.

Trying to update node-build... ok
Downloading node-v18.12.0-darwin-x64.tar.gz...
-> https://nodejs.org/dist/v18.12.0/node-v18.12.0-darwin-x64.tar.gz
error: failed to download node-v18.12.0-darwin-x64.tar.gz
-> https://nodejs.org/dist/v18.12.0/node-v18.12.0-darwin-x64.tar.gz
error: failed to download node-v18.12.0-darwin-x64.tar.gz

BUILD FAILED (OS X 13.2 using node-build 4.9.88-78-g8ead6fb3)

Binary installation failed; try compiling from source with `--compile` flag

Also, reading some issues I tried some commands, like:

arch -x86_64 zsh

and after that ran the installation unsuccessfully.

@anthonator
Copy link

We're seeing the same thing.

@augustobmoura
Copy link
Member

Can you guys check if it is related to nodenv/node-build#777?

I'm unable to test on an M1 MacOS. If someone is able to do some debugging please share on this post

@shadowspawn
Copy link

There was a problem with intermittent 404s affecting downloads from nodejs, which is hopefully largely resolved:

@augustobmoura
Copy link
Member

augustobmoura commented Mar 16, 2023

Thanks for the information, @shadowspawn! That could be it

But I find it strange that only Apple Silicon versions are being affected, and running asdf on Rosetta solves the issue. I will let the issue open while we don't confirm that the problem is purely on NodeJS servers.

@jtlimo @anthonator please try downloading that version later after NodeJS update its status as fixed, and confirm if that was the problem

@anthonator
Copy link

Seems to be working for me.

@jtlimo
Copy link
Author

jtlimo commented Mar 17, 2023

I tried here and the problem continue

@kalupa
Copy link

kalupa commented Mar 17, 2023

Had trouble with this yesterday due to the 404s. appears to have resolved itself now. no need to use --compile anymore, i think

@jtlimo
Copy link
Author

jtlimo commented Mar 20, 2023

Had trouble with this yesterday due to the 404s. appears to have resolved itself now. no need to use --compile anymore, i think

I tried again, and nothing changed. 😢

@genu
Copy link

genu commented Mar 21, 2023

I'm seeing this as well, not sure if its related exactly, but I run these commands:

> asdf latest nodejs
> 19.8.1

> asdf install nodejs 19.18.1
> Trying to update node-build... ok
> node-build: definition not found: 19.18.1

@johnbendi
Copy link

What's going on?

@augustobmoura
Copy link
Member

augustobmoura commented Apr 14, 2023

I'm seeing this as well. Not sure if it is related exactly, but I run these commands:

> asdf latest nodejs
> 19.8.1

> asdf install nodejs 19.18.1
> Trying to update node-build... ok
> node-build: definition not found: 19.18.1

There is a typo on your installation command. The latest version is 19.8.1, but you ran the command trying to install 19.18.1. You can avoid re-typing the version number by running the command asdf install nodejs latest.

Again, I cannot reproduce the issue on Linux. If someone else is having this problem on macOS, I would ask to debug it if possible or to provide more information on what could be happening.

@jtlimo, is the issue still happening? Did you try updating both asdf-code and asdf-nodejs? Try running this command to update all your plugins otherwise:

asdf update
asdf plugin update --all

@johnbendi
Copy link

My case was also related to #299 which was occuring after a recent update and somehow also giving me the node-build: definition not found: message. Clearing the cache as suggested from there solved it for me.

@owpac
Copy link

owpac commented Apr 14, 2023

Hello, in the same way, I can't install Nodejs v19.9.0. The latest version found by asdf is v19.8.1 🫠

I tried to erase my cache with rm -rf $ASDF_DIR/tmp/nodejs but it didn't change anything. I also tried to update asdf & asdf plugin-update --all but nothing either.

What's going on?

@jtlimo
Copy link
Author

jtlimo commented Apr 14, 2023

I'm seeing this as well. Not sure if it is related exactly, but I run these commands:

> asdf latest nodejs
> 19.8.1

> asdf install nodejs 19.18.1
> Trying to update node-build... ok
> node-build: definition not found: 19.18.1

There is a typo on your installation command. The latest version is 19.8.1, but you ran the command trying to install 19.18.1. You can avoid re-typing the version number by running the command asdf install nodejs latest.

Again, I cannot reproduce the issue on Linux. If someone else is having this problem on macOS, I would ask to debug it if possible or to provide more information on what could be happening.

@jtlimo, is the issue still happening? Did you try updating both asdf-code and asdf-nodejs? Try running this command to update all your plugins otherwise:

asdf update
asdf plugin update --all

Hi, the issue is still happening. I'll try these commands and comeback here;

Tried the commands, and the issue is still happening 😢

Also, how to debug to help with more informations?

@mrienstra
Copy link

@owpac, see #345

@OvermindDL1
Copy link

OvermindDL1 commented May 5, 2023

Same issue for me on linux as well:

❯ asdf install nodejs 20.1.0          
Trying to update node-build... ok
Downloading node-v20.1.0-linux-x64.tar.gz...
-> https://nodejs.org/dist/v20.1.0/node-v20.1.0-linux-x64.tar.gz
error: failed to download node-v20.1.0-linux-x64.tar.gz
-> https://nodejs.org/dist/v20.1.0/node-v20.1.0-linux-x64.tar.gz
error: failed to download node-v20.1.0-linux-x64.tar.gz

BUILD FAILED (Ubuntu 22.04 using node-build 4.9.115)

Binary installation failed; try compiling from source with `--compile` flag

❯ asdf install nodejs 20.1.0 --compile
Trying to update node-build... ok
Downloading node-v20.1.0-linux-x64.tar.gz...
-> https://nodejs.org/dist/v20.1.0/node-v20.1.0-linux-x64.tar.gz
error: failed to download node-v20.1.0-linux-x64.tar.gz
-> https://nodejs.org/dist/v20.1.0/node-v20.1.0-linux-x64.tar.gz
error: failed to download node-v20.1.0-linux-x64.tar.gz

BUILD FAILED (Ubuntu 22.04 using node-build 4.9.115)

Binary installation failed; try compiling from source with `--compile` flag

Tried all the 19's and 20's that are available in list-all, same results.

I do have aria2c, manually downloading the above url's via aria2c and curl both works fine.

@OvermindDL1
Copy link

Removing aria2c from the PATH fixes it for some reason, so try that for anyone else having this issue.

@mrienstra
Copy link

@OvermindDL1, sounds like a new issue worth reporting! https://github.com/asdf-vm/asdf-nodejs/issues/new/choose

@augustobmoura
Copy link
Member

@jtlimo can you check if removing aria2c from path solves the issue? It looks like the project is not being maintained for some time and it does have some unsolved issues on MacOS and DNS. I will try pushing a PR to node-build so it can stop using it as the default downloader

@lxe
Copy link

lxe commented May 30, 2023

Same issue here on Windows 11 Ubuntu WSL:

$ asdf install nodejs lts
Cloning node-build...
node-build: definition not found: 18

20.2.0 installs fine.

@M77ix
Copy link

M77ix commented May 30, 2023

I'm also having the issue where i cant download Nodejs, I get the error message: error: failed to download node v18.16.0-darwin-x64.tar.gz BUILD FAILED (OS X 13.3.1 using node-build 4.9.115-3-gf32092ec). I tried everything mentioned here and more and can't seem to resolve the issue I had previously installed some NodeJS version without issue but now I cant download any of them, I get the same error message each time! I'm on Mac with an Intel chip

@M77ix
Copy link

M77ix commented May 31, 2023

Update: I managed to fix the issue, for some reason anaconda was messing up the install and uninstalling it fixed the problem !

@jvbs
Copy link

jvbs commented Jun 1, 2023

Same here @lxe

W10 WSL2 Arch Linux

@zackerydev
Copy link

I was having this issue - thought it might be aria2c but wasn't able to find that installed anywhere.

If you land here it could be because of IPv6, the network I was on didn't support it so I had to do:

 NODE_BUILD_CURL_OPTS=--ipv4 asdf install nodejs 20.5.0

@jtlimo
Copy link
Author

jtlimo commented Aug 24, 2023

I was having this issue - thought it might be aria2c but wasn't able to find that installed anywhere.

If you land here it could be because of IPv6, the network I was on didn't support it so I had to do:

 NODE_BUILD_CURL_OPTS=--ipv4 asdf install nodejs 20.5.0

I tried with NODE_BUILD_CURL_OPTS=--ipv4 asdf install nodejs 20.5.0 but I have the same error.

@jtlimo
Copy link
Author

jtlimo commented Aug 24, 2023

Seeing #363 and tried some commands from there and nothing changes.

One thing different it's when I running this:

ASDF_NODEJS_VERBOSE_INSTALL=true asdf install nodejs

results:

Trying to update node-build... ok
/var/folders/_6/34r_v3ps59s7gmtrczrkw_s40000gq/T/node-build.20230824115414.32255.PDnmth ~
Downloading node-v16.0.0-darwin-arm64.tar.gz...
-> https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz
curl: (60) SSL certificate problem: self-signed certificate in certificate chain
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
error: failed to download node-v16.0.0-darwin-arm64.tar.gz
-> https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz
curl: (60) SSL certificate problem: self-signed certificate in certificate chain
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
error: failed to download node-v16.0.0-darwin-arm64.tar.gz

BUILD FAILED (OS X 13.2 using node-build 4.9.120)

Binary installation failed; try compiling from source with `--compile` flag

@jdx
Copy link

jdx commented Aug 24, 2023

issue is upstream: nodejs/nodejs.org#5666

@augustobmoura
Copy link
Member

Seeing #363 and tried some commands from there and nothing changes.

One thing different it's when I running this:

ASDF_NODEJS_VERBOSE_INSTALL=true asdf install nodejs

What happens if you try downloading the file manually from a browser?
For the URL: https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz

Try also downloading from curl directly from your terminal:

curl -O https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz

@augustobmoura
Copy link
Member

augustobmoura commented Aug 24, 2023

Also, @jtlimo, are you using any kind of VPN? Even Apple's Private Relay could interfere
Can you also try running the same command from on a different network? Maybe from mobile data, or try to use a different VPN if you have access to one

@jdx
Copy link

jdx commented Aug 24, 2023

@augustobmoura see nodejs/nodejs.org#5666. nodejs.org is having issues that I'm guessing may be related to this: nodejs/build#3469

@jtlimo
Copy link
Author

jtlimo commented Aug 24, 2023

Seeing #363 and tried some commands from there and nothing changes.
One thing different it's when I running this:
ASDF_NODEJS_VERBOSE_INSTALL=true asdf install nodejs

What happens if you try downloading the file manually from a browser? For the URL: https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz

Try also downloading from curl directly from your terminal:

curl -O https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz

It's succesfull when run the curl command

@augustobmoura
Copy link
Member

@augustobmoura see nodejs/nodejs.org#5666. nodejs.org is having issues that I'm guessing may be related to this: nodejs/build#3469

Yeah, but the error messages look different, @jtlimo can't even hit the server because of TLS problems. And also, I'm not having problems downloading the 16 version

It's succesfull when run the curl command

That's weird, I'm not sure why would it fail on node-build and not on the regular command line. Let me check which other options node-build is adding to the command. Also, check if there are no new updates to curl, bash or packages in general. With brew, just run brew update && brew upgrade

@jdx
Copy link

jdx commented Aug 24, 2023

The issues are intermittent and don't always report the same issue. I've been having connection issues with rtx and github actions connecting to nodejs.org all week. This is not asdf or node-build related. Sometimes it's 404, sometimes 500, and sometimes it's just really slow.

@augustobmoura
Copy link
Member

Ok, lets wait for it to stabilize again, and check if the --ipv4 does anything

@Matozinho
Copy link

Hi guys!

I'm facing the same issue here. I was getting the same output of @jtlimo, but installing the current LTS version (18.17.1)

asdf info:

Linux <my-host> 6.2.0-32-generic #32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

ASDF VERSION:
v0.13.0-43ca61a

ASDF INSTALLED PLUGINS:
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master 9275f49

FIX:

It seems the problem is related to aria2c, so I removed it from the HTTP clients list in ~/.asdf/plugins/nodejs/.node-build/bin/node-build

image

It just occurs with the LTS version.

@alissonpelizaro
Copy link

I'm seeing this as well, not sure if its related exactly, but I run these commands:

> asdf latest nodejs
> 19.8.1

> asdf install nodejs 19.18.1
> Trying to update node-build... ok
> node-build: definition not found: 19.18.1

This works fine here.

@shane-lamb
Copy link

shane-lamb commented Nov 7, 2023

The solution from @Matozinho worked for me, but I found that the underlying issue was that aria2c was broken, as per this issue. I fixed that by using the solution presented in the linked issue - by updating the gettext library using homebrew (brew upgrade gettext). If that works for you then you don't need to edit the source code anymore, which is preferable.

@andycarlberg
Copy link

Since this is still a problem in aria2 as @shane-lamb noted, I thought it might be helpful to know there's an easier way to implement the fix from @Matozinho.

You can use a node-build setting variable to set the NODE_BUILD_HTTP_CLIENT before running your command.

@hamman3223
Copy link

I just reinstalled aria2c with brew and it worked for me ☺️. I discovered an error related to aria2c, when I did asdf install nodejs 18.15.0. The developers should change the log indicating that an error occurred during downloading, because it's false positive

When I raised output verbosity with ASDF_NODEJS_VERBOSE_INSTALL=true I got this error:

~ ASDF_NODEJS_VERBOSE_INSTALL=true asdf install nodejs

Trying to update node-build... ok
/var/folders/bb/d4lv2jmn4tqc1vkr7nyjk24c0000gn/T/node-build.20231129010321.30913.UrCx05 ~/.asdf/plugins/nodejs
Downloading node-v18.15.0-darwin-arm64.tar.gz...
-> https://nodejs.org/dist/v18.15.0/node-v18.15.0-darwin-arm64.tar.gz
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString stringByStandardizingPath]: unrecognized selector sent to instance 0x600001578570'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001865fe800 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x00000001860f5eb4 objc_exception_throw + 60
	2   CoreFoundation                      0x00000001866b03bc -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x0000000186568a84 ___forwarding___ + 1572
	4   CoreFoundation                      0x00000001865683a0 _CF_forwarding_prep_0 + 96
	5   Foundation                          0x000000018763d8a0 -[NSProcessInfo arguments] + 188
	6   CoreFoundation                      0x0000000186679fd8 __getDefaultArguments_block_invoke + 96
	7   libdispatch.dylib                   0x00000001862ff910 _dispatch_client_callout + 20
	8   libdispatch.dylib                   0x000000018630114c _dispatch_once_callout + 32
	9   CoreFoundation                      0x0000000186679974 _addBackstopValuesForIdentifierAndSource + 640
	10  CoreFoundation                      0x00000001865342ac __81-[_CFXPreferences(SourceAdditions) withNamedVolatileSourceForIdentifier:perform:]_block_invoke + 144```

@sephethus
Copy link

Problem continues on M2 MacBook Pro

asdf install nodejs 20.11.1        
Trying to update node-build... ok
Downloading node-v20.11.1-darwin-arm64.tar.gz...
-> https://nodejs.org/dist/v20.11.1/node-v20.11.1-darwin-arm64.tar.gz
error: failed to download node-v20.11.1-darwin-arm64.tar.gz

BUILD FAILED (OS X 14.3.1 using node-build 4.9.138)

Binary installation failed; try compiling from source with `--compile` flag

@Resa-Obamwonyi
Copy link

Problem continues on M2 MacBook Pro

asdf install nodejs 20.11.1        
Trying to update node-build... ok
Downloading node-v20.11.1-darwin-arm64.tar.gz...
-> https://nodejs.org/dist/v20.11.1/node-v20.11.1-darwin-arm64.tar.gz
error: failed to download node-v20.11.1-darwin-arm64.tar.gz

BUILD FAILED (OS X 14.3.1 using node-build 4.9.138)

Binary installation failed; try compiling from source with `--compile` flag

Hi, were you able to resolve this? i am having the same issue with my M1

@onetwo-manoj-manoharan
Copy link

The solution from @Matozinho worked for me, but I found that the underlying issue was that aria2c was broken, as per this issue. I fixed that by using the solution presented in the linked issue - by updating the gettext library using homebrew (brew upgrade gettext). If that works for you then you don't need to edit the source code anymore, which is preferable.

@Resa-Obamwonyi the above solution by @andycarlberg worked for me

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