I installed node using homebrew (Mojave), afterwards php stoped working and if I try to run php -v I get this error:
php -v
php -v dyld: Library not lo
Run npm version, if you see the same error, upgrade npm.
npm version
brew upgrade npm.
brew upgrade npm
==> Upgrading 1 outdated package, with result: npm 8.1.2 -> 10.3.0 ==> Upgrading npm ==> Installing dependencies for node: icu4c ==> Installing node dependency: icu4c
Credits