nvm is not compatible with the npm config “prefix” option:

前端 未结 16 1435
梦毁少年i
梦毁少年i 2020-12-07 06:47

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\         


        
16条回答
  •  死守一世寂寞
    2020-12-07 07:41

    I have the same error message but other solution. The autogenerated path during curl (install.sh) does not match. Check this with:

    echo $NVM_DIR
    

    In my case: /var/www//.nvm. Show in your auto generated bash file and change it and replace it: (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc)

    replace

    export NVM_DIR="$HOME/.nvm"
    

    with (e.g.)

    export NVM_DIR="$HOME.nvm"
    

提交回复
热议问题