使用brew时报错

问题1:npm install 时报错 `gyp` failed with exit code: 1

解决方案:

可以先在命令行执行一下

pkg-config

如果提示command not found: pkg-config则可以按照以下方式解决

command not found: pkg-config

安装pkg-config

brew install pkg-config

问题1:使用brew时报错:The following directories are not writable by your user: /usr/local/share/man/man5

描述:

当我们用Homebrew安装应用时,会出现此问题,显示Homebrew无法访问这些位置并添加在OS X上为您安装软件所需的文件,我们应尝试回收权限,

解决方案如下:

首先打开终端,然后输入:

sudo chown -R `whoami`:admin /usr/local/bin

接着系统会提醒你输入密码,输入密码回车之后接着输入:

sudo chown -R `whoami`:admin /usr/local/share

之后就能在终端中重新使用用brew install 安装文件就可以了

参考

Mac - brew 安装缺少访问文件权限

https://blog.csdn.net/weisubao/article/details/105464662

你可能感兴趣的:(使用brew时报错)