执行命令重新安装libpng
brew reinstall libpng
1.在系统中找到 libpng16.16.dylib
find /opt -name "libpng16.16.dylib"
#结果
/opt/homebrew/lib/libpng16.16.dylib
/opt/homebrew/Cellar/libpng/1.6.37/lib/libpng16.16.dylib
2.如果不存在则安装
brew install libpng
3.创建文件夹
sudo mkdir -p /usr/local/opt/libpng/lib/
4.设置软链接
sudo ln -s /opt/homebrew/lib/libpng16.16.dylib /usr/local/opt/libpng/lib/libpng16.16.dylib