介绍
mac下的homebrew直接使用brew install node
安装的node版本是14.+
,这给很多程序带来了问题,如果直接安装低版本的node会造成‘npm’等无法使用。
卸载
1 | brew remove node |
解绑
卸载之后要先把之前node解除连接。1
brew unlink node
查找可用的node版本
1 | brew search node |

安装
1 | brew install node@10 |

添加环境变量
1 | vi ~/.bash_profile |

经过此步骤还是无法在终端使用‘node -v’就增加1
2vi ~/.bash_profile
alias node='/usr/local/opt/node@10/bin/node'
无法使用npm
等情况执行1
brew link --overwrite --force node@10