Odd Error: dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

Getting this error randomly on deploy (fresh provision)

TASK [deploy : Install npm dependencies] *****************************************************************************************************************************************************
System info:
  Ansible 2.4.3.0; Darwin
  Trellis at "Add `xdebug.remote_autostart` to simplify xdebug sessions"
---------------------------------------------------
non-zero return code
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found
fatal: [206.189.199.105]: FAILED! => {"changed": true, "cmd": ["yarn"], "delta": "0:00:00.388240", "end": "2018-05-11 18:20:44.012606", "rc": -6, "start": "2018-05-11 18:20:43.624366", "stderr_lines": ["dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib", "  Referenced from: /usr/local/bin/node", "  Reason: image not found"], "stdout": "", "stdout_lines": []}
        to retry, use: --limit @/Users/josephroberts/localdev/atlantaestatelawcenter.com/trellis/deploy.retry

PLAY RECAP ***********************************************************************************************************************************************************************************
206.189.199.105            : ok=12   changed=3    unreachable=0    failed=1
localhost                  : ok=0    changed=0    unreachable=0    failed=0

Tried brew unlink icu4c && brew link icu4c and also brew reinstall icu4c.

I don’t know if this is helpful. But I’m also noticing this when I run valet install (which I know isn’t trellis, but I think that’d be helpful info).

valet install                                                                                                                           ✔  2363  18:37:21
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
Password:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
/usr/local/bin/valet: line 54: 73980 Abort trap: 6           php "$DIR/cli/valet.php" "$@"

Some more helpful info:
I’m not sure what to do with this, but I get this when running brew doctor

brew doctor                                                                                                                           1 ↵  2370  18:42:54
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 or file an issue; just ignore this. 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/libopenh264-1.4.0-osx64.dylib

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"' >> ~/.zshrc

Warning: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/opt/ansible@2.4

I manage my local system’s dependencies with homebrew. Including ansible and python.

Thoughts?

Solved finally by running brew reinstall node. Hopefully this post will be helpful for somebody. :slight_smile:

2 Likes

FWIW, we recommend using https://github.com/creationix/nvm for managing your Node versions :eyes:

2 Likes

I was literally just wishing I had something like this!

$ brew install node
$ brew install node@8
$ node -v
v10.4.1
$ brew unlink node
$ brew link node@8
Warning: node@8 is keg-only and must be linked with --force
Note that doing so can interfere with building software.

If you need to have this software first in your PATH instead consider running:
echo ‘export PATH="/usr/local/opt/node@8/bin:$PATH"’ >> ~/.bash_profile

We still recommend using https://github.com/creationix/nvm for managing your Node versions.

2 Likes