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

前端 未结 16 1394
梦毁少年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:42

    I had this issue after moving my home folder to a new drive on linux. It was fixed by removing .nvm folder and reinstalling nvm

    0 讨论(0)
  • 2020-12-07 07:44

    Just resolved the issue. I symlinked $HOME/.nvm to $DEV_ZONE/env/node/nvm directory. I was facing same issue. I replaced NVM_DIR in $HOME/.zshrc as follows

    export NVM_DIR="$DEV_ZONE/env/node/nvm"
    

    BTW, please install NVM using curl or wget command not by using brew. For more please check the comment in this issue on Github: 855#issuecomment-146115434

    0 讨论(0)
  • 2020-12-07 07:45

    I ran into this while using node installed via nvm, with nvm installed via homebrew. I solved it by running brew uninstall nvm, rm -rf $NVM_DIR, then reinstalling nvm using the official install script and reinstalling the node version I needed.

    Note: I also had $NVM_DIR mounted and symlinked. I moved it back into my homedir.

    0 讨论(0)
  • 2020-12-07 07:46

    Note:
    to remove, delete, or uninstall nvm - just remove the $NVM_DIR folder (usually ~/.nvm)
    you can try :
    rm -rf ~/.nvm

    0 讨论(0)
提交回复
热议问题