mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-12-06 22:52:23 +03:00
Sourcing nvm.sh fails when the caller has made readonly a variable that nvm.sh declares as a local, such as `readonly VERSION` in a CI build script: bash rejects the `local`, and dash exits. Prefix the locals that sourcing and its `nvm use` reach. The test derives the unprefixed local names from nvm.sh, so a new collision fails it. `nvm_install_default_packages` reported an invalid default-packages file by assigning `nvm`'s `EXIT_CODE` without declaring it. It now declares its own, and `nvm install` uses its return status instead, except 3, which means npm failed to install the packages and, as before, does not fail the install. Fixes #3584 Signed-off-by: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com> Co-authored-by: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com> Co-authored-by: Jordan Harband <ljharb@gmail.com>