mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-20 04:23:43 +00:00
Compare commits
3 Commits
11991eec8c
...
6688647757
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6688647757 | ||
![]() |
6b70c40f15 | ||
![]() |
477353e1a4 |
10
nvm.sh
10
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
|
||||||
@ -2046,6 +2047,11 @@ nvm_get_arch() {
|
|||||||
local EXIT_CODE
|
local EXIT_CODE
|
||||||
local LONG_BIT
|
local LONG_BIT
|
||||||
|
|
||||||
|
if [ -n "$NVM_NODEJS_ORG_ARCH" ]; then
|
||||||
|
nvm_echo "${NVM_NODEJS_ORG_ARCH}"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
NVM_OS="$(nvm_get_os)"
|
NVM_OS="$(nvm_get_os)"
|
||||||
# If the OS is SunOS, first try to use pkgsrc to guess
|
# If the OS is SunOS, first try to use pkgsrc to guess
|
||||||
# the most appropriate arch. If it's not available, use
|
# the most appropriate arch. If it's not available, use
|
||||||
|
Loading…
x
Reference in New Issue
Block a user