新的系统更新后对一些重要目录的权限进行了限制,原先安装的homebrew可能会出现一些问题
附上一条安装homebrew命令
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
可尝试用这句话更改权限
sudo chown -R $(whoami):admin /usr/local
这个问题出现的原因是,
Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile
BasildeMacBook:~ Basil$ vim ~/.bash_profile
可以通过配置环境变量来解决,在.bash_profile,加入这条数据
export PATH="/usr/local/sbin:$PATH"
然后
source ~/.bash_profile
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
aria2
maven
pkg-config
wget
xz
解决办法:重新建立brew 和软件之间的关联
BasildeMacBook:~ Basil$ brew link maven
Linking /usr/local/Cellar/maven/3.3.9... 0 symlinks created
BasildeMacBook:~ Basil$ brew link pkg-config
Linking /usr/local/Cellar/pkg-config/0.29.1_1... 2 symlinks created
BasildeMacBook:~ Basil$ brew link pkg-config
Warning: Already linked: /usr/local/Cellar/pkg-config/0.29.1_1
To relink: brew unlink pkg-config && brew link pkg-config
BasildeMacBook:~ Basil$ brew link wget
Linking /usr/local/Cellar/wget/1.18... 0 symlinks created
BasildeMacBook:~ Basil$ brew link sz
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/node/android-ifaddrs.h
/usr/local/include/node/ares.h
/usr/local/include/node/ares_version.h
/usr/local/include/node/libplatform/libplatform.h
/usr/local/include/node/nameser.h
/usr/local/include/node/node.h
/usr/local/include/node/node_buffer.h
/usr/local/include/node/node_object_wrap.h
/usr/local/include/node/node_version.h
/usr/local/include/node/openssl/aes.h
/usr/local/include/node/openssl/archs/aix-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/aix64-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/BSD-x86/opensslconf.h
/usr/local/include/node/openssl/archs/BSD-x86_64/opensslconf.h
解决办法:
删除这些文件
rm -rf /usr/local/include/node (注意:要慎用rm -rf命令)