Brew install nvm. nvm: command not found

前端 未结 3 1184
长情又很酷
长情又很酷 2021-02-07 02:25

After install nvm with brew, and running nvm, it says nvm: command not found

How can I get the command to execute?

相关标签:
3条回答
  • 2021-02-07 03:05

    I had the same problem after running npm install

    The following solution worked for me:

    1. Run brew doctor to find broken symlinks for NPM

    2. Run brew cleanup to clean them up

    0 讨论(0)
  • 2021-02-07 03:15

    There are two steps to installing nvm with brew.

    First use brew to install the application:

    brew install nvm

    Then take a look at the brew info "caveats" section, to see what else you have to do:

    brew info nvm

    You might see something like (this can change!):

    You should create NVM's working directory if it doesn't exist:
    
      mkdir ~/.nvm
    
    Add the following to ~/.bash_profile or your desired shell
    configuration file:
    
      export NVM_DIR="$HOME/.nvm"
      . "/usr/local/opt/nvm/nvm.sh"
    

    If you do not have a ~/.bash_profile file, then you can simply create one.

    Make sure to restart your terminal before trying the command.

    0 讨论(0)
  • 2021-02-07 03:19

    From the docs:

    Your system may not have a [.bash_profile file] where the command is set up. Simply create one with touch ~/.bash_profile and run the install script again

    you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.

    Restarting worked for me...Why can't all bugs be so easy?!!

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