Skip to content
Myr

[patch] Update docs and add warning for 'nvm is not compatible with the npm config "prefix" option' edgecase error on Mac OS

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Dimitris Karagiannis · committed by Jordan Harband · parent a5aec10 · Browse files · 2 files+16 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−0 removed

  • other:+16 added−0 removed

2 files+16 added−0 removed

modified:nvm.sh+6 added
2199 unmodified lines
2200 return2201 fi22022203 local NVM_NPM_PREFIX2204 local NVM_OS2205 NVM_OS="$(nvm_get_os)"2206 NVM_NPM_PREFIX="$(npm config --loglevel=warn get prefix)"2207 if ! (nvm_tree_contains_path "${NVM_DIR}" "${NVM_NPM_PREFIX}" >/dev/null 2>&1); then2208 if [ "_${NVM_DELETE_PREFIX}" = "_1" ]; then2209 npm config --loglevel=warn delete prefix
4 unmodified lines
2214 nvm_err "Run \`npm config delete prefix\` or \`${NVM_COMMAND}\` to unset it."2215 else2216 nvm_err "Run \`${NVM_COMMAND}\` to unset it."2217 fi2218 if [ "${NVM_OS}" = 'darwin' ]; then2219 nvm_err "Make sure your username ($(whoami)) matches the one in your \$HOME path."2220 nvm_err "See the \"macOS Troubleshooting\" section in the docs for more information."2221 fi2222 return 102223 fi2224 fi2225}
1576 unmodified lines
modified:README.md+10 added
803 unmodified lines
804```805806More on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).807808**nvm is not compatible with the npm config "prefix" option**809810Some solutions for this issue can be found [here](https://github.com/nvm-sh/nvm/issues/1245)811812There 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**.813814You have to make sure that the user directory name in `$HOME` and the user directory name you'd see from running `ls /Users/` **are capitalized the same way** ([See this issue](https://github.com/nvm-sh/nvm/issues/2261)).815816To change the user directory and/or account name follow the instructions [here](https://support.apple.com/en-us/HT201548)817818[1]: https://github.com/nvm-sh/nvm.git819[2]: https://github.com/nvm-sh/nvm/blob/v0.35.3/install.sh820[3]: https://travis-ci.org/nvm-sh/nvm821[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.35.3
2 unmodified lines