brew 安装教程yarn 下载brew install yarn
yarn 下载依赖包时报错,如图:

node版本:v18.7.0node-sass版本:v5.0.0由于node 版本过高,导致两者不兼容 自行查询node与node-sass版本
node,下载匹配node-sass版本卸载node
brew uninstall node@18 --force // node@版本号
如果没有配置环境变量,执行完此命令后,node -v 输出:node: command not found

删除配置的环境变量
.bash_profile文件「没有此文件默认创建」touch ~/.bash_profile
.bash_profile文件删除node的配置 「如果在步骤二出现报错,这种情况可能是环境变量没有删除」open ~/.bash_profile
bash_profile文件source ~/.bash_profile
安装node
brew search node

node,根据提示执行相应的命令即可顺利完成安装
node 安装完成后,进入项目根目录执行yarn下载依赖

到这里即是结束!㊗️好运