mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-28 20:51:34 +00:00
[patch] Update docs and add warning for 'nvm is not compatible with the npm config "prefix" option' edgecase error on Mac OS
This commit is contained in:

committed by
Jordan Harband

parent
a5aec107df
commit
a01deb11dc
6
nvm.sh
6
nvm.sh
@@ -2201,6 +2201,8 @@ nvm_die_on_prefix() {
|
||||
fi
|
||||
|
||||
local NVM_NPM_PREFIX
|
||||
local NVM_OS
|
||||
NVM_OS="$(nvm_get_os)"
|
||||
NVM_NPM_PREFIX="$(npm config --loglevel=warn get prefix)"
|
||||
if ! (nvm_tree_contains_path "${NVM_DIR}" "${NVM_NPM_PREFIX}" >/dev/null 2>&1); then
|
||||
if [ "_${NVM_DELETE_PREFIX}" = "_1" ]; then
|
||||
@@ -2213,6 +2215,10 @@ nvm_die_on_prefix() {
|
||||
else
|
||||
nvm_err "Run \`${NVM_COMMAND}\` to unset it."
|
||||
fi
|
||||
if [ "${NVM_OS}" = 'darwin' ]; then
|
||||
nvm_err "Make sure your username ($(whoami)) matches the one in your \$HOME path."
|
||||
nvm_err "See the \"macOS Troubleshooting\" section in the docs for more information."
|
||||
fi
|
||||
return 10
|
||||
fi
|
||||
fi
|
||||
|
Reference in New Issue
Block a user