Files
nvm/test/fast/Unit tests
NUAAwqyandJordan Harband a66a5ae5d2 [Fix] nvm.sh: use NVM_-prefixed locals in the sourcing path
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>
2026-11-28 06:30:00 +00:00
..