Skip to content

Commit

Permalink
Update docs and add warning for directory naming mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarajohn committed Aug 3, 2020
1 parent a5aec10 commit 894d52d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,16 @@ sudo chmod ugo-x /usr/libexec/path_helper
More on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).
**nvm is not compatible with the npm config "prefix" option**
Some solutions for this issue can be found [here](https://github.com/nvm-sh/nvm/issues/1245)
There is one more edge case causing this issue, and that's a **mismatch between the `$HOME` path and the user's home directory's actual name**.
You have to make sure that the user directory name in `$HOME` and the user directory name you'd see from running `ls /Users/` **are capitalised the same way** ([See this issue](https://github.com/nvm-sh/nvm/issues/2261)).
To change the user directory and/or account name follow the instructions [here](https://support.apple.com/en-us/HT201548)
[1]: https://github.com/nvm-sh/nvm.git
[2]: https://github.com/nvm-sh/nvm/blob/v0.35.3/install.sh
[3]: https://travis-ci.org/nvm-sh/nvm
Expand Down
6 changes: 6 additions & 0 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 home directory name 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
Expand Down

0 comments on commit 894d52d

Please sign in to comment.