-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding descriptions about symlinks in the 'nvm is not compatible with the npm config "prefix" option' error #1385
Comments
The intention is for the string in nvm.sh to contain The true fix is related to #617 - it would need to change In the meantime, adding more information to the error message seems very helpful. |
nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local/Cellar/nvm/0.33.0/versions/node/v5.11.0" how why?sorry,my english is poor |
@qq756585379 Please file a separate issue; but |
i have installed via homebrew and also via curl , i find
|
@qq756585379 |
@ljharb yes,can you say 中文 |
Google translate gives me: but that's the best i can do. |
@ljharb thanks,你很棒 |
I have ran into two machines that shows
nvm is not compatible with the npm config "prefix" option
error everytime~/.nvm/nvm.sh
is invoked, and which is also mentioned by existing issues.In the end, I found that in both my machines, the home directories is symlinked to another location. By modifying the nvm load script
.bashrc
to setNVM_DIR
to the path after symlink resolution, the error goes away for good. It works in new bash sessions as well.That is, if in your machine it says something like
then your nvm will blow up with
nvm is not compatible with the npm config "prefix" option
. To correctly solve the issue, we should changeNVM_DIR
from$HOME/.nvm
to something like/srv/home/username/.nvm
.I think the error message was useless in helping me figure this out. I spent some time tracing
nvm.sh
, insertingecho
and disabling--silence
to see my echo, to found that the system admin has setup those symlinks, and it is those symlinks that broke nvm.Specifically, when the condition of this
if
statement turns true, it does not necessarily means thatnpm config get prefix
is set by anothernpm
instance. It just means thatnvm
is not sure if the prefix is set by nvm itself. I think extending the error message here to include the symlink issue can help others encountering this issue, since it is not uncommon to have home directories symlinked to somewhere else.The text was updated successfully, but these errors were encountered: