比如安装的是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
网友评论