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

2022-01-14  本文已影响0人  温柔vs先生

比如安装的是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
上一篇 下一篇

猜你喜欢

热点阅读