mac终端安装node时候,显示“-bash: brew: command not found”,怎么解决?

mac终端安装node时候,显示“-bash: brew: command not found”,怎么解决?
图片描述

图片描述

阅读 13.9k
4 个回答

先安装brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

没安装 Homebrew

bash 下执行 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

如果出现 brew not found :

sudo find / -name brew # 查看是否存在 brew, 如果不存在就删除下述两个文件
rm -rf /usr/local/Cellar
rm -rf /usr/local/.git

然后重新安装 brew 就 ok 了

新手上路,请多包涵

删了以后,终端连ls,ll,....这些命令都不能用了;
Last login: Thu Sep 27 16:37:03 on ttys000
-bash: “.:/usr/local/bin”: No such file or directory
xxydeMacBook-Pro:~ xiang$ ruby -e "$(curl -fsSL https://raw.githubusercontent...)"
-bash: curl: command not found
-bash: ruby: command not found
xxydeMacBook-Pro:~ xiang$ cd /bin
xxydeMacBook-Pro:bin xiang$ ll
-bash: ll: command not found
xxydeMacBook-Pro:bin xiang$
好大一个坑。。。。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏