From 86c937436d68dc3693642b5d28848076cd2eed45 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 14 Jul 2026 23:10:33 -0700 Subject: [PATCH] [Robustness] `nvm_get_arch`: only apply the Alpine musl suffix when the OS is linux The `/etc/alpine-release` check applied the -musl suffix regardless of the resolved OS. In practice Alpine is always linux, so this is behavior-neutral, but it also makes the `nvm_get_arch` unit test hermetic: its mocked smartos/osx cases no longer pick up a real host's Alpine marker. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index acf99378..3559058b 100755 --- a/nvm.sh +++ b/nvm.sh @@ -2251,7 +2251,7 @@ nvm_get_arch() { HOST_ARCH=armv7l fi - if [ -f "/etc/alpine-release" ]; then + if [ -f "/etc/alpine-release" ] && [ "_${NVM_OS}" = "_linux" ]; then # Alpine Linux uses musl libc; map to musl variants where available # See https://unofficial-builds.nodejs.org/download/release/ case "${NVM_ARCH}" in