为什么许多cli应用程序似乎崩溃了?


0

最新款MacBook Pro 512GB 2017。

例如:

$ php
dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
Abort trap: 6

它确实从我昨天运行Ccleaner开始,但我运行的是64位版本,而不是Windows,所以肯定不相关?

似乎大多数情况下,但不仅仅是brew安装的应用程序受到影响。

Process:               php [79030]
Path:                  /usr/local/Cellar/php70/7.0.20_12/bin/php
Identifier:            php
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        bash [78809]
Responsible:           php [79030]
User ID:               501

Date/Time:             2017-09-20 16:47:24.210 +0200
OS Version:            Mac OS X 10.12.6 (16G29)
Report Version:        12

Time Awake Since Boot: 940000 seconds
Time Since Wake:       37000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found

Binary Images:
       0x10fe1e000 -        0x11079effb +php (0) <80DC9E50-D749-366A-BC44-517201E78D84> /usr/local/bin/php
       0x11095d000 -        0x110acd727 +libcrypto.1.0.0.dylib (0) <11B495A9-782C-3FB0-9729-ACFCD9F4F53E> /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
       0x110b48000 -        0x110b89ff7 +libssl.1.0.0.dylib (0) <35C152E0-7168-3B99-94AB-ECA04D3B3DB5> /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
       0x110bae000 -        0x110bd1ff3 +libreadline.7.dylib (0) <E16A5AF1-953F-3274-BFBA-725FD9973D8D> /usr/local/opt/readline/lib/libreadline.7.dylib
       0x110beb000 -        0x110bf3ff3 +libintl.8.dylib (0) <9A1967E0-AC59-3EF6-B14F-643AF08A6B4F> /usr/local/opt/gettext/lib/libintl.8.dylib
       0x110bfe000 -        0x110c21ffb +libpng16.16.dylib (0) <949DC3DD-DB87-3DE9-9615-FCF16DCBAC61> /usr/local/opt/libpng/lib/libpng16.16.dylib
       0x11f841000 -        0x11f87edc7  dyld (433.5) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fff81931000 -     0x7fff81967fff  com.apple.LDAPFramework (2.4.28 - 194.5) <492ACA22-373E-3DD9-BAEB-9EF6AA962FD5> /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
    0x7fff9303b000 -     0x7fff93047ffb  libexslt.0.dylib (15.9) <0FEE938A-AD8C-344A-8240-32550E0B9C7B> /usr/lib/libexslt.0.dylib
    0x7fff93050000 -     0x7fff93142ff7  libiconv.2.dylib (50) <42125B35-81D7-3FC4-9475-A26DBE10884D> /usr/lib/libiconv.2.dylib
    0x7fff9364a000 -     0x7fff9367bffb  libncurses.5.4.dylib (51.30.1) <B03B1BD2-7080-3856-BB02-7E8238320C3B> /usr/lib/libncurses.5.4.dylib
    0x7fff93b1f000 -     0x7fff93b3bffb  libresolv.9.dylib (64) <A244AE4C-00B0-396C-98FF-97FE4DB3DA30> /usr/lib/libresolv.9.dylib
    0x7fff93ef6000 -     0x7fff93f07ff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib

节点也受到同样的影响:

$ node
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.58.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found

屏幕错误:

Process:               node [79078]
Path:                  /usr/local/Cellar/node/8.1.2/bin/node
Identifier:            node
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        bash [78809]
Responsible:           node [79078]
User ID:               501

Date/Time:             2017-09-20 16:51:15.877 +0200
OS Version:            Mac OS X 10.12.6 (16G29)
Report Version:        12

Time Awake Since Boot: 940000 seconds
Time Since Wake:       37000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.58.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found

Binary Images:
       0x100000000 -        0x100e845df +node (???) <95A4D949-1196-3BB6-A361-8196E3D6972B> /usr/local/bin/node
       0x104e27000 -        0x104e64dc7  dyld (433.5) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld

Model: MacBookPro14,3, BootROM MBP143.0160.B02, 4 processors, Intel Core i7, 2,9 GHz, 16 GB, SMC 2.45f0
Graphics: kHW_AMDRadeonPro560Item, Radeon Pro 560, PCIe, 4096 MB
Graphics: kHW_IntelHDGraphics630Item, Intel HD Graphics 630, Built-In
Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320
Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x173), Broadcom BCM43xx 1.0 (7.21.171.130.1a1)
Bluetooth: Version 5.0.5f1, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB 3.0 Bus
USB Device: iBridge
Thunderbolt Bus: MacBook Pro, Apple Inc., 22.2
Thunderbolt Bus: MacBook Pro, Apple Inc., 22.2

我运行了建议的brew命令:

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libjson-c.2.dylib
  /usr/local/lib/libykclient.3.dylib
  /usr/local/lib/libykpers-1.1.dylib
  /usr/local/lib/libyubikey.0.dylib

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/python2.7/greenlet/greenlet.h
  /usr/local/include/python3.6m/greenlet/greenlet.h


Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
  brew install graphviz libcroco librsvg

Run `brew missing` for more details.

乍一看,你有一个常见的错误 - dylib。看到这个Q / A:stackoverflow.com/questions/32703296
Allan

Answers:


2

有些东西要么从磁盘移动或删除库,要么替换库版本而不更新其依赖项。看看是否brew switch jpeg 8d有效并解决了问题。如果没有,最简单的操作 - 虽然有点霰弹枪的方法 - 是重新安装所有已安装的自制软件包,你可以通过运行

brew list | xargs brew reinstall

在终端。您也可以只重新安装遇到问题的软件包(brew reinstall <package>但是,您不必重新安装Homebrew本身。

可以通过运行建议的命令来修复它brew,即:

brew install graphviz libcroco librsvg

但似乎您的二进制文件与libjpeg&c的版本相关联。通过其他方式安装,所以干净的重新安装可能是最好的行动方案。


0
brew reinstall php@7.0 # Swap PHP version as needed.

在运行此命令后,我不得不重新安装我之前安装的自定义PHP模块。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.