Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AungHtetPaing__'s avatar

npm install getting error after switch php version

Hi, i try to switch php version and mess up everything. When i run php -v and composer install, i get this error.

dyld: Library not loaded: /usr/local/opt/tidy-html5/lib/libtidy.5.dylib
  Referenced from: /usr/local/opt/[email protected]/bin/php
  Reason: image not found
[1]    20030 abort      php -v

installing tidy-html5 don't work So i switch back to previous php version, composer install and php-v work fine but npm install getting error

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.69.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found
[1]    25098 abort      npm install

I tried to install icu4c with brew install icu4c but it doesn't solve the error. Plz anyone know solution? I already searched on google and didn't find solution yet.

0 likes
1 reply
AungHtetPaing__'s avatar

I also get this error

Error: /usr/local/Cellar/php/8.1.3_1 is not a directory

when i try brew install tidy-html5 or something like that.

Please or to participate in this conversation.