Home  >  Article  >  Backend Development  >  Why Does Installing Node with Brew Cause a "Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib" Error for PHP?

Why Does Installing Node with Brew Cause a "Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib" Error for PHP?

Barbara Streisand
Barbara StreisandOriginal
2024-11-13 06:51:02994browse

Why Does Installing Node with Brew Cause a

Troubleshooting dyld Error: "Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib" for PHP After Installing Node with Brew

Problem:

Upon installing Node using Homebrew on macOS Mojave, PHP encounters an error upon execution with "php -v":

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

Uninstalling both Node and icu4c does not resolve the issue.

Solution:

To address this error, try the following steps:

  1. Upgrade Homebrew: Run the command brew update to update Homebrew itself.
  2. Upgrade Individual Packages or All Brew Packages: Execute brew upgrade icu4c to upgrade the icu4c package specifically. Alternatively, upgrade all packages using the command brew upgrade.
  3. Cleanup Homebrew: Run brew cleanup to remove any outdated or unused packages.

Additional Considerations:

  • If upgrading individual packages does not resolve the issue, try upgrading all brew packages using the command brew upgrade.
  • Be cautious when using brew upgrade // as it upgrades all brew packages, potentially including PHP.
  • If the error persists, consider reinstalling Node using the Homebrew package manager.

Follow these steps to resolve the issue and ensure PHP functions properly even after installing Node with Homebrew.

The above is the detailed content of Why Does Installing Node with Brew Cause a "Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib" Error for PHP?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn