调用 'pkg-config --libs-only-l Qt5Core Qt5Network Qt5Widgets 返回退出状态 1

Call to 'pkg-config --libs-only-l Qt5Core Qt5Network Qt5Widgets returned exit status 1

环境信息:

我已经安装了 Qt 和 QtWebkit 插件。安装成功,可以打开QtCreator gui

在使用 Qt 的节点项目上使用

I 运行 和 npm install 命令。该命令以以下错误结束:

Package 'Qt5WebKit' has no Description: field
gyp: Call to 'pkg-config --libs-only-l Qt5Core Qt5Network Qt5Widgets Qt5Gui Qt5WebKit Qt5WebKitWidgets Qt5Test' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/rando/.nvm/versions/node/v9.6.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:127:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 5.8.0-44-generic
gyp ERR! command "/home/rando/.nvm/versions/node/v9.6.1/bin/node" "/home/rando/.nvm/versions/node/v9.6.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/rando/Desktop/git/master-node/node/browser_engines/src/browsers/webkit
gyp ERR! node -v v9.6.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! company-browser-webkit@0.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the company-browser-webkit@0.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rando/.npm/_logs/2021-03-02T16_42_43_655Z-debug.log

我已经配置了如下环境变量:

export QT_HOME=/opt/Qt/5.9.9/gcc_64
export PATH=$PATH:$QT_HOME/bin
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$QT_HOME/lib/pkgconfig;

我也尝试过为 Qt5Core.pc、Qt5GUI.pc 和 [= 创建符号链接 QtCore.pc、QtGUI.pc 和 QtNetwork.pc,但没有任何运气64=]。这没有解决我的问题。


执行以下命令returns:

pkg-config --libs-only-l Qt5Core Qt5Network Qt5Widgets Qt5Gui Qt5WebKit Qt5WebKitWidgets Qt5Test

输出如下信息:

Package 'Qt5WebKit' has no Description: field

我通过转到目录解决了这个问题:${QT_HOME}/gcc_64/lib/pkgconfig 目录并通过添加如下描述修改了文件(Qt5WebKit.pc、Qt5WebKitWidgets.pc):

  • Qt5WebKit.pc
Name: Qt5WebKit
Description: Qt Web Kit
Version: 5.212.0
Libs: -L/home/qt/work/install/lib -lQt5WebKit
Cflags: -I/home/qt/work/install/include/Qt5WebKit 
Requires: Qt5Core Qt5Gui Qt5Network
  • Qt5WebKitWidgets.pc
Name: Qt5WebKitWidgets
Description: Qt Web Kit Widgets
Version: 5.212.0
Libs: -L/home/qt/work/install/lib -lQt5WebKitWidgets
Cflags: -I/home/qt/work/install/include/Qt5WebKitWidgets 
Requires: