[Fix] nvm_get_arch: only apply musl suffix on x64 Alpine

Alpine detection unconditionally set `x64-musl` regardless of actual architecture, which would be incorrect on ARM-based Alpine containers.

Bug introduced in ef7fc2f2c0 / #3212.
Fixes #3616.
This commit is contained in:
Jordan Harband
2026-03-14 12:53:14 -07:00
parent a5de7236d6
commit 39e71eab49
4 changed files with 62 additions and 1 deletions

5
nvm.sh
View File

@@ -2171,7 +2171,10 @@ nvm_get_arch() {
fi
if [ -f "/etc/alpine-release" ]; then
NVM_ARCH=x64-musl
# Alpine Linux uses musl libc; only x64-musl binaries are available
case "${NVM_ARCH}" in
x64) NVM_ARCH=x64-musl ;;
esac
fi
nvm_echo "${NVM_ARCH}"