当前位置:   article > 正文

mac系统升级到10.12后homebrew不能正常使用的问题_homebrew's "sbin" was not found in your path but y

homebrew's "sbin" was not found in your path but you have installed formulae

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

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

可尝试用这句话更改权限

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

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
  • 1
  • 2
  • 3
  • 4
  • 5

可以通过配置环境变量来解决,在.bash_profile,加入这条数据

export PATH="/usr/local/sbin:$PATH"
  • 1

然后

source ~/.bash_profile
  • 1

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

解决办法:重新建立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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

解决办法:
删除这些文件

rm -rf /usr/local/include/node  (注意:要慎用rm -rf命令)
  • 1
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读