mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-13 07:31:51 +00:00
Merge 869b273c77
into ab49a5b0c3
This commit is contained in:
commit
7693a611c3
30
nvm.sh
30
nvm.sh
@ -1534,22 +1534,26 @@ nvm_die_on_prefix() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local NVM_NPM_PREFIX
|
check_prefix() {
|
||||||
NVM_NPM_PREFIX="$(NPM_CONFIG_LOGLEVEL=warn npm config get prefix)"
|
local NVM_NPM_PREFIX
|
||||||
if ! (nvm_tree_contains_path "$NVM_DIR" "$NVM_NPM_PREFIX" >/dev/null 2>&1); then
|
NVM_NPM_PREFIX="$(NPM_CONFIG_LOGLEVEL=warn npm config get prefix 2>&1)"
|
||||||
if [ "_$NVM_DELETE_PREFIX" = "_1" ]; then
|
if ! (nvm_tree_contains_path "$NVM_DIR" "$NVM_NPM_PREFIX" >/dev/null 2>&1); then
|
||||||
NPM_CONFIG_LOGLEVEL=warn npm config delete prefix
|
if [ "_$NVM_DELETE_PREFIX" = "_1" ]; then
|
||||||
else
|
NPM_CONFIG_LOGLEVEL=warn npm config delete prefix
|
||||||
nvm deactivate >/dev/null 2>&1
|
|
||||||
echo >&2 "nvm is not compatible with the npm config \"prefix\" option: currently set to \"$NVM_NPM_PREFIX\""
|
|
||||||
if nvm_has 'npm'; then
|
|
||||||
echo >&2 "Run \`npm config delete prefix\` or \`$NVM_COMMAND\` to unset it."
|
|
||||||
else
|
else
|
||||||
echo >&2 "Run \`$NVM_COMMAND\` to unset it."
|
nvm deactivate >/dev/null 2>&1
|
||||||
|
echo >&2 ""
|
||||||
|
echo >&2 "nvm is not compatible with the npm config \"prefix\" option: currently set to \"$NVM_NPM_PREFIX\""
|
||||||
|
if nvm_has 'npm'; then
|
||||||
|
echo >&2 "Run \`npm config delete prefix\` or \`$NVM_COMMAND\` to unset it."
|
||||||
|
else
|
||||||
|
echo >&2 "Run \`$NVM_COMMAND\` to unset it."
|
||||||
|
fi
|
||||||
|
return 10
|
||||||
fi
|
fi
|
||||||
return 10
|
|
||||||
fi
|
fi
|
||||||
fi
|
}
|
||||||
|
(check_prefix &)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Succeeds if $IOJS_VERSION represents an io.js version that has a
|
# Succeeds if $IOJS_VERSION represents an io.js version that has a
|
||||||
|
Loading…
Reference in New Issue
Block a user