asdf-nodejs icon indicating copy to clipboard operation
asdf-nodejs copied to clipboard

Cannot install latest lts [email protected]

Open jlarmstrongiv opened this issue 1 year ago • 2 comments

BUILD FAILED (OS X 14.3.1 using node-build 4.9.99-174-g9122e14b)

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

Inspect or clean up the working tree at /var/folders/zf/2l3hc6vn12v7r89t45mhxzhm0000gn/T/node-build.20240329024320.31743.2hX97b
Results logged to /var/folders/zf/2l3hc6vn12v7r89t45mhxzhm0000gn/T/node-build.20240329024320.31743.log

Last 10 log lines:
Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
e5f607|OK  |    44MiB/s|/private/var/folders/zf/2l3hc6vn12v7r89t45mhxzhm0000gn/T/node-build.20240329024320.31743.2hX97b/node-v20.12.0-darwin-x64.tar.gz

Status Legend:
(OK):download completed.
No version is set for command shasum
Consider adding one of the following versions in your config file at
perl 5.32.1

It seems the main issue is No version is set for command shasum

Occurs on both x86_64 and arm64 macOS Sonoma

jlarmstrongiv avatar Mar 29 '24 08:03 jlarmstrongiv

More info on the error, which persists in 20.12.1. It seems you can install any version so long as you are not in a folder with a .tool-versions file. In that case, it will only print a warning.

asdf install nodejs 20.12.1
Trying to update node-build... ok
No version is set for command shasum
Consider adding one of the following versions in your config file at /Users/user/.tool-versions
perl 5.32.1
Downloading node-v20.12.1-darwin-arm64.tar.gz...
-> https://nodejs.org/dist/v20.12.1/node-v20.12.1-darwin-arm64.tar.gz
Installing node-v20.12.1-darwin-arm64...
Installed node-v20.12.1-darwin-arm64 to /Users/user/.asdf/installs/nodejs/20.12.1

asdf: Warn: You have configured asdf to preserve downloaded files (with always_keep_download=yes or --keep-download). But
asdf: Warn: the current plugin (nodejs) does not support that. Downloaded files will not be preserved.

jlarmstrongiv avatar Apr 03 '24 21:04 jlarmstrongiv

Hey!

I confirm that https://github.com/asdf-vm/asdf-nodejs/issues/388#issuecomment-2035636157 is a working workaround.

# remove .tool-versions file when it exists as a regular file
# (tested with darwin, zsh). 
# it may work with linux distros, bash.
test -e .tool-versions && rm .tool-versions || true

asdf install nodejs 20.12.1

 # to restore .tool-versions file
echo 'nodejs 20.12.1' > .tool-versions

thierrymarianne avatar Apr 04 '24 14:04 thierrymarianne

This is because your shasum command is coming from another asdf plugin. From the logs it looks like they are comming from asdf-perl. Either set a global version for asdf-perl or make sure the shasum system binary is being used before running asdf install

Edit: Relevant log lines:

No version is set for command shasum
Consider adding one of the following versions in your config file at /Users/user/.tool-versions
perl 5.32.1

augustobmoura avatar Jul 30 '24 15:07 augustobmoura