mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-19 20:13:44 +00:00
Compare commits
4 Commits
ebdd5b2f53
...
db68f29051
Author | SHA1 | Date | |
---|---|---|---|
![]() |
db68f29051 | ||
![]() |
6b70c40f15 | ||
![]() |
5f7d419458 | ||
![]() |
b42c165667 |
11
nvm.sh
11
nvm.sh
@ -196,6 +196,9 @@ nvm_install_latest_npm() {
|
|||||||
nvm_echo 'Attempting to upgrade to the latest working version of npm...'
|
nvm_echo 'Attempting to upgrade to the latest working version of npm...'
|
||||||
local NODE_VERSION
|
local NODE_VERSION
|
||||||
NODE_VERSION="$(nvm_strip_iojs_prefix "$(nvm_ls_current)")"
|
NODE_VERSION="$(nvm_strip_iojs_prefix "$(nvm_ls_current)")"
|
||||||
|
local NPM_VERSION
|
||||||
|
NPM_VERSION="$(npm --version 2>/dev/null)"
|
||||||
|
|
||||||
if [ "${NODE_VERSION}" = 'system' ]; then
|
if [ "${NODE_VERSION}" = 'system' ]; then
|
||||||
NODE_VERSION="$(node --version)"
|
NODE_VERSION="$(node --version)"
|
||||||
elif [ "${NODE_VERSION}" = 'none' ]; then
|
elif [ "${NODE_VERSION}" = 'none' ]; then
|
||||||
@ -206,8 +209,6 @@ nvm_install_latest_npm() {
|
|||||||
nvm_err 'Unable to obtain node version.'
|
nvm_err 'Unable to obtain node version.'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
local NPM_VERSION
|
|
||||||
NPM_VERSION="$(npm --version 2>/dev/null)"
|
|
||||||
if [ -z "${NPM_VERSION}" ]; then
|
if [ -z "${NPM_VERSION}" ]; then
|
||||||
nvm_err 'Unable to obtain npm version.'
|
nvm_err 'Unable to obtain npm version.'
|
||||||
return 2
|
return 2
|
||||||
@ -4529,7 +4530,11 @@ nvm_supports_xz() {
|
|||||||
if [ "_${NVM_OS}" = '_darwin' ]; then
|
if [ "_${NVM_OS}" = '_darwin' ]; then
|
||||||
local MACOS_VERSION
|
local MACOS_VERSION
|
||||||
MACOS_VERSION="$(sw_vers -productVersion)"
|
MACOS_VERSION="$(sw_vers -productVersion)"
|
||||||
if nvm_version_greater "10.9.0" "${MACOS_VERSION}"; then
|
if tar --version | command grep -q GNU && ! command which xz >/dev/null 2>&1; then
|
||||||
|
# On macOS with GNU tar in use, and no xv on the path, xv-compressed
|
||||||
|
# tarballs aren't supported
|
||||||
|
return 1
|
||||||
|
elif nvm_version_greater "10.9.0" "${MACOS_VERSION}"; then
|
||||||
# macOS 10.8 and earlier doesn't support extracting xz-compressed tarballs with tar
|
# macOS 10.8 and earlier doesn't support extracting xz-compressed tarballs with tar
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user