就我而言,我在运行 npm i 时收到了下一条错误消息:
node-gyp rebuild
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libffi', required by 'gobject-2.0', not found
gyp: Call to 'pkg-config --cflags cairo poppler-qt5' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
我发现问题出在导出 PATH
所以我跑了brew reinstall -s poppler
在安装结束时,您可以运行路径的导出
If you need to have qt first in your PATH run:
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc
For compilers to find qt you may need to set:
export LDFLAGS="-L/usr/local/opt/qt/lib"
export CPPFLAGS="-I/usr/local/opt/qt/include"
For pkg-config to find qt you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"
这为我修好了。
我希望你觉得它有帮助。