Search code examples
qtnpmubuntu-20.04pkg-config

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


Environment Information:

  • OS: Ubuntu 20.04
  • Node JS version: v9.6.1
  • npm version: 5.6.0
  • Qt - >Qt 5.9.9 (Custom Installation with including the options below)
    • Qt 5.9.9 -> Desktop gcc 64-bit
    • Qt 5.9.9 -> Qt Network Authorization
    • Qt 5.9.9 -> Qt Script (Deprecated)
  • qtwebkit version: 5.212

I have installed Qt and along with QtWebkit plugin. The installation was successful and i am able to open the QtCreator gui.

I running and npm install command on node project that uses Qt. The command ends with following error:

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

I have configured the environment variables as below:

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;

I also try it without any luck to create sym links QtCore.pc, QtGUI.pc, and QtNetwork.pc for Qt5Core.pc, Qt5GUI.pc, and Qt5Network.pc. This didn't solve my issue.


The execution of the following command returns :

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

output the message below:

Package 'Qt5WebKit' has no Description: field

Solution

  • I solved this issue by going to the directory: ${QT_HOME}/gcc_64/lib/pkgconfig directory and modified the files (Qt5WebKit.pc, Qt5WebKitWidgets.pc)by adding the description like below:

    • 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: