mac系统升级到10.12后homebrew不能正常使用的问题

新的系统更新后对一些重要目录的权限进行了限制,原先安装的homebrew可能会出现一些问题
附上一条安装homebrew命令

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

可尝试用这句话更改权限

sudo chown -R $(whoami):admin /usr/local

1.
这个问题出现的原因是,

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

2.

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

3.

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命令)
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值