美文网首页
Mac brew 安装指定版本后 node命令找不到

Mac brew 安装指定版本后 node命令找不到

作者: 温柔vs先生 | 来源:发表于2022-01-14 12:32 被阅读0次

    比如安装的是14的版本

    brew install node@14
    
    

    执行node命令无法使用,可以执行如下命令

    brew link --overwrite --force node@14
    

    下面是执行后的内容:

    wbb@wubangbangdeMacBook-Pro ~ % brew link --overwrite --force node@14
    Linking /usr/local/Cellar/node@14/14.18.2... 3868 symlinks created.
    
    If you need to have this software first in your PATH instead consider running:
      echo 'export PATH="/usr/local/opt/node@14/bin:$PATH"' >> ~/.zshrc
    

    如果报这个错:

    Warning: Homebrew's sbin was not found in your PATH but you haveinstalled
    formulae that put executables in /usr/local/sbin.
    Consider setting the PATH for example like so
    echo 'exportPATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile
    

    解决方法:

    export PATH="/usr/local/bin:$PATH"
    source ~/.bash_profile
    

    相关文章

      网友评论

          本文标题:Mac brew 安装指定版本后 node命令找不到

          本文链接:https://www.haomeiwen.com/subject/hveacrtx.html