asdf-vm / asdf-nodejs

Node.js plugin for asdf version manager

Home Page:https://github.com/asdf-vm/asdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install latest lts node@20.12.0

jlarmstrongiv opened this issue · 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

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.

Hey!

I confirm that #388 (comment) 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