[Fix] if a prefix env var is set (as in npm run), but is correct, do not fail
Fixes #2106.
parent
0899839b95
commit
6fa92c82ca
2
nvm.sh
2
nvm.sh
|
@ -2187,7 +2187,7 @@ nvm_die_on_prefix() {
|
|||
if [ -n "${NVM_NPM_CONFIG_PREFIX_ENV-}" ]; then
|
||||
local NVM_CONFIG_VALUE
|
||||
eval "NVM_CONFIG_VALUE=\"\$${NVM_NPM_CONFIG_PREFIX_ENV}\""
|
||||
if [ -n "${NVM_CONFIG_VALUE-}" ]; then
|
||||
if [ -n "${NVM_CONFIG_VALUE-}" ] && ! nvm_tree_contains_path "${NVM_DIR}" "${NVM_CONFIG_VALUE}"; then
|
||||
nvm deactivate >/dev/null 2>&1
|
||||
nvm_err "nvm is not compatible with the \"${NVM_NPM_CONFIG_PREFIX_ENV}\" environment variable: currently set to \"${NVM_CONFIG_VALUE}\""
|
||||
nvm_err "Run \`unset ${NVM_NPM_CONFIG_PREFIX_ENV}\` to unset it."
|
||||
|
|
Loading…
Reference in New Issue