I am trying to run another NodeJS version with nvm
but getting this error:
$ nvm use v4.2.4
nvm is not compatible with the npm config \"prefix\
This error can occur when your NVM installation folder path has a Symbolic Link.
The default installation path of NVM is: $HOME/.nvm
but your home folder could be a symbolic link for another drive, like my case.
Example, my home folder is a Symbolic Link to aother drive:
/home/myuser -> /bigdrive/myuser
This cause the prefix problem.
On your startup script (.bashrc or .zshrc or other), change the NVM folder to the direct path.
Ex: NVM_DIR="/bigdrive/myuser/.nvm"
.
.bashrc
export NVM_DIR="/bigdrive/myuser/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"