mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-17 19:13:43 +00:00
Compare commits
6 Commits
5735d057d8
...
54310eb1f2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
54310eb1f2 | ||
![]() |
1d39e35bd3 | ||
![]() |
19f452ba0f | ||
![]() |
b9b0ea8020 | ||
![]() |
dae1427f7e | ||
![]() |
cae2eb71a2 |
5
.github/workflows/latest-npm.yml
vendored
5
.github/workflows/latest-npm.yml
vendored
@ -37,6 +37,11 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
|
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
|
||||||
include:
|
include:
|
||||||
|
- node-version: "21"
|
||||||
|
- node-version: "20.5"
|
||||||
|
- node-version: "20.4"
|
||||||
|
- node-version: "14.17"
|
||||||
|
- node-version: "14.16"
|
||||||
- node-version: "9.2"
|
- node-version: "9.2"
|
||||||
- node-version: "9.1"
|
- node-version: "9.1"
|
||||||
- node-version: "9.0"
|
- node-version: "9.0"
|
||||||
|
3
.github/workflows/toc.yml
vendored
3
.github/workflows/toc.yml
vendored
@ -20,6 +20,7 @@ jobs:
|
|||||||
allowed-endpoints:
|
allowed-endpoints:
|
||||||
github.com:443
|
github.com:443
|
||||||
registry.npmjs.org:443
|
registry.npmjs.org:443
|
||||||
|
api.github.com:443
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# https://github.com/actions/checkout/issues/217#issue-599945005
|
# https://github.com/actions/checkout/issues/217#issue-599945005
|
||||||
@ -30,7 +31,7 @@ jobs:
|
|||||||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: 'lts/*'
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run doctoc
|
- run: npm run doctoc
|
||||||
- name: commit changes
|
- name: commit changes
|
||||||
|
@ -163,7 +163,8 @@ install_nvm_from_git() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
# Cloning repo
|
# Cloning repo
|
||||||
command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
|
command git clone "$(nvm_source)" --depth=1 -o origin "${INSTALL_DIR}" 2> /dev/null \
|
||||||
|
|| command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
|
||||||
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
|
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
25
nvm.sh
25
nvm.sh
@ -354,6 +354,21 @@ nvm_install_latest_npm() {
|
|||||||
if [ $NVM_IS_19_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 20.5.0; then
|
if [ $NVM_IS_19_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 20.5.0; then
|
||||||
NVM_IS_20_5_OR_ABOVE=1
|
NVM_IS_20_5_OR_ABOVE=1
|
||||||
fi
|
fi
|
||||||
|
local NVM_IS_20_17_or_ABOVE
|
||||||
|
NVM_IS_20_17_or_ABOVE=0
|
||||||
|
if [ $NVM_IS_20_5_OR_ABOVE -eq 1 ] && nvm_version_greater 20.17.0 "${NODE_VERSION}"; then
|
||||||
|
NVM_IS_20_17_or_ABOVE=1
|
||||||
|
fi
|
||||||
|
local NVM_IS_21_OR_ABOVE
|
||||||
|
NVM_IS_21_OR_ABOVE=0
|
||||||
|
if [ $NVM_IS_20_17_or_ABOVE -eq 1 ] && nvm_version_greater 21.0.0 "${NODE_VERSION}"; then
|
||||||
|
NVM_IS_21_OR_ABOVE=1
|
||||||
|
fi
|
||||||
|
local NVM_IS_22_9_OR_ABOVE
|
||||||
|
NVM_IS_22_9_OR_ABOVE=0
|
||||||
|
if [ $NVM_IS_21_OR_ABOVE -eq 1 ] && nvm_version_greater 22.9.0 "${NODE_VERSION}"; then
|
||||||
|
NVM_IS_22_9_OR_ABOVE=1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $NVM_IS_4_4_OR_BELOW -eq 1 ] || {
|
if [ $NVM_IS_4_4_OR_BELOW -eq 1 ] || {
|
||||||
[ $NVM_IS_5_OR_ABOVE -eq 1 ] && nvm_version_greater 5.10.0 "${NODE_VERSION}"; \
|
[ $NVM_IS_5_OR_ABOVE -eq 1 ] && nvm_version_greater 5.10.0 "${NODE_VERSION}"; \
|
||||||
@ -399,8 +414,15 @@ nvm_install_latest_npm() {
|
|||||||
[ $NVM_IS_18_17_OR_ABOVE -eq 0 ] \
|
[ $NVM_IS_18_17_OR_ABOVE -eq 0 ] \
|
||||||
|| { [ $NVM_IS_19_OR_ABOVE -eq 1 ] && [ $NVM_IS_20_5_OR_ABOVE -eq 0 ]; } \
|
|| { [ $NVM_IS_19_OR_ABOVE -eq 1 ] && [ $NVM_IS_20_5_OR_ABOVE -eq 0 ]; } \
|
||||||
; then
|
; then
|
||||||
|
# TODO: 10.8.3 can run on 16.20.2?? https://github.com/nodejs/Release/issues/884#issuecomment-2558077691
|
||||||
nvm_echo '* `npm` `v9.x` is the last version that works on `node` `< v18.17`, `v19`, or `v20.0` - `v20.4`'
|
nvm_echo '* `npm` `v9.x` is the last version that works on `node` `< v18.17`, `v19`, or `v20.0` - `v20.4`'
|
||||||
$NVM_NPM_CMD install -g npm@9
|
$NVM_NPM_CMD install -g npm@9
|
||||||
|
elif \
|
||||||
|
[ $NVM_IS_20_17_or_ABOVE -eq 0 ] \
|
||||||
|
|| { [ $NVM_IS_21_OR_ABOVE -eq 1 ] && [ $NVM_IS_22_9_OR_ABOVE -eq 0 ]; } \
|
||||||
|
; then
|
||||||
|
nvm_echo '* `npm` `v10.x` is the last version that works on `node` `< v20.17`, `v21`, or `v22.0` - `v22.8`'
|
||||||
|
$NVM_NPM_CMD install -g npm@10
|
||||||
else
|
else
|
||||||
nvm_echo '* Installing latest `npm`; if this does not work on your node version, please report a bug!'
|
nvm_echo '* Installing latest `npm`; if this does not work on your node version, please report a bug!'
|
||||||
$NVM_NPM_CMD install -g npm
|
$NVM_NPM_CMD install -g npm
|
||||||
@ -422,8 +444,7 @@ fi
|
|||||||
if [ -z "${NVM_DIR-}" ]; then
|
if [ -z "${NVM_DIR-}" ]; then
|
||||||
# shellcheck disable=SC2128
|
# shellcheck disable=SC2128
|
||||||
if [ -n "${BASH_SOURCE-}" ]; then
|
if [ -n "${BASH_SOURCE-}" ]; then
|
||||||
# shellcheck disable=SC2169,SC3054
|
NVM_SCRIPT_SOURCE="${BASH_SOURCE}"
|
||||||
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
|
|
||||||
fi
|
fi
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
NVM_DIR="$(nvm_cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" >/dev/null && \pwd)"
|
NVM_DIR="$(nvm_cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" >/dev/null && \pwd)"
|
||||||
|
0
test/slow/nvm uninstall/Running 'nvm uninstall' with incorrect file permissions fails nicely
Executable file → Normal file
0
test/slow/nvm uninstall/Running 'nvm uninstall' with incorrect file permissions fails nicely
Executable file → Normal file
Loading…
x
Reference in New Issue
Block a user