添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Unable to install @nodegui/nodegui #705

Closed
@DanRYoung

Description

Describe the bug
Install @nodegui/nodegui via npm fails during the prebuild:install script due to missing header files on Ubuntu 20.04 (or even via a node Docker container)

To Reproduce

sudo apt-get install pkg-config build-essential -y
sudo apt-get install cmake make -y
mkdir installer-test
cd installer-test
npm init -y
npm install @nodegui/nodegui

Dockerfile to Reproduce

from node:14.11.0-stretch
RUN apt-get update -y && \
    apt-get install pkg-config build-essential -y && \
    apt-get install cmake make -y && \
    mkdir test-node-gui && \
    cd test-node-gui && \
    npm init -y && \
    npm install @nodegui/nodegui

Expected behavior
The package should be installed successfully via npm.

Desktop (please complete the following information):

  • OS: Ubuntu (20.04) (or the node:14.11.0-* images)
  • NodeGUI version: 0.25.0
  • Additional context

    Environment

    $ cmake --version
    cmake version 3.16.3
    $ npm --version               
    6.14.8
    $ node --version
    v14.11.0
    

    Output

    ➜  installer-test npm install @nodegui/nodegui
    npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
    npm WARN deprecated [email protected]: this library is no longer supported
    > @nodegui/[email protected] postinstall /home/d/projects/installer-test/node_modules/@nodegui/qode
    > node install.js
    Cached archive already exists at /home/d/.cache/qode-nodejs/qode-linux-x64-v2.1.0.tar.gz. Skipping download....
    Extracting /home/d/.cache/qode-nodejs/qode-linux-x64-v2.1.0.tar.gz to /home/d/projects/installer-test/node_modules/@nodegui/qode/binaries ...
    Qode was setup successfully at : /home/d/projects/installer-test/node_modules/@nodegui/qode/binaries
    > @nodegui/[email protected] postinstall /home/d/projects/installer-test/node_modules/@nodegui/nodegui
    > cross-env npm run setupqt && (node ./scripts/skip.js || npm run prebuild:install || npm run build:addon)
    > @nodegui/[email protected] setupqt /home/d/projects/installer-test/node_modules/@nodegui/nodegui
    > cross-env node ./scripts/setupMiniQt.js
    Minimal Qt 5.14.1 setup:
    Archive already exists at /home/d/.cache/nodegui-mini-qt-nodejs/5.14.1-0-202001240953qtbase-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64.7z. Skipping download....
    Extracting /home/d/.cache/nodegui-mini-qt-nodejs/5.14.1-0-202001240953qtbase-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64.7z to /home/d/projects/installer-test/node_modules/@nodegui/nodegui/miniqt ...
    Archive already exists at /home/d/.cache/nodegui-mini-qt-nodejs/5.14.1-0-202001240953icu-linux-Rhel7.2-x64.7z. Skipping download....
    Extracting /home/d/.cache/nodegui-mini-qt-nodejs/5.14.1-0-202001240953icu-linux-Rhel7.2-x64.7z to /home/d/projects/installer-test/node_modules/@nodegui/nodegui/miniqt ...
    Qt ICU for Minimal Qt: 5.14.1 installation was setup successfully.  outDir: /home/d/projects/installer-test/node_modules/@nodegui/nodegui/miniqt
    Qt Base for Minimal Qt: 5.14.1 installation was setup successfully.  outDir: /home/d/projects/installer-test/node_modules/@nodegui/nodegui/miniqt
    > @nodegui/[email protected] prebuild:install /home/d/projects/installer-test/node_modules/@nodegui/nodegui
    > prebuild-install --backend=cmake-js --runtime=napi --verbose
    prebuild-install info begin Prebuild-install version 5.3.5
    prebuild-install info looking for cached prebuild @ /home/d/.npm/_prebuilds/726bab-nodegui-v0.25.0-napi-v3-linux-x64.tar.gz
    prebuild-install http request GET https://github.com/nodegui/nodegui/releases/download/v0.25.0/nodegui-v0.25.0-napi-v3-linux-x64.tar.gz
    prebuild-install http 404 https://github.com/nodegui/nodegui/releases/download/v0.25.0/nodegui-v0.25.0-napi-v3-linux-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=3 runtime=napi arch=x64 libc= platform=linux)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! @nodegui/[email protected] prebuild:install: `prebuild-install --backend=cmake-js --runtime=napi --verbose`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the @nodegui/[email protected] prebuild:install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/d/.npm/_logs/2020-10-01T17_31_11_960Z-debug.log
    > @nodegui/[email protected] build:addon /home/d/projects/installer-test/node_modules/@nodegui/nodegui
    > cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile
      '/usr/bin/node',
      '/home/d/projects/installer-test/node_modules/.bin/cmake-js',
      'compile'
    info TOOL Using Unix Makefiles generator.
    info CMD CONFIGURE
    info RUN cmake "/home/d/projects/installer-test/node_modules/@nodegui/nodegui" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="6.1.0" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/home/d/projects/installer-test/node_modules/@nodegui/nodegui/build/Release" -DCMAKE_JS_INC="/home/d/.cmake-js/node-x64/v14.11.0/include/node" -DCMAKE_JS_SRC="" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="14.11.0" -DNODE_ARCH="x64"
    Not searching for unused variables given on the command line.
    -- The C compiler identification is GNU 9.3.0
    -- The CXX compiler identification is GNU 9.3.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Using QT installation for nodegui_core QT_CMAKE_HOME_DIR:/home/d/projects/installer-test/node_modules/@nodegui/nodegui/miniqt/5.14.1/gcc_64/lib/cmake/Qt5
    **CMake Error at miniqt/5.14.1/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
      Failed to find "GL/gl.h" in "/usr/include/libdrm".**
    Call Stack (most recent call first):
      miniqt/5.14.1/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:207 (include)
      miniqt/5.14.1/gcc_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:100 (find_package)
      miniqt/5.14.1/gcc_64/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
      config/qt.cmake:23 (find_package)
      CMakeLists.txt:204 (AddQtSupport)
    -- Configuring incomplete, errors occurred!
    See also "/home/d/projects/installer-test/node_modules/@nodegui/nodegui/build/CMakeFiles/CMakeOutput.log".
    info REP Build has been failed, trying to do a full rebuild.
    info CMD CLEAN
    info RUN cmake -E remove_directory "/home/d/projects/installer-test/node_modules/@nodegui/nodegui/build"
    info CMD CONFIGURE
    info RUN cmake "/home/d/projects/installer-test/node_modules/@nodegui/nodegui" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="6.1.0" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/home/d/projects/installer-test/node_modules/@nodegui/nodegui/build/Release" -DCMAKE_JS_INC="/home/d/.cmake-js/node-x64/v14.11.0/include/node" -DCMAKE_JS_SRC="" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="14.11.0" -DNODE_ARCH="x64"
    Not searching for unused variables given on the command line.
    -- The C compiler identification is GNU 9.3.0
    -- The CXX compiler identification is GNU 9.3.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Using QT installation for nodegui_core QT_CMAKE_HOME_DIR:/home/d/projects/installer-test/node_modules/@nodegui/nodegui/miniqt/5.14.1/gcc_64/lib/cmake/Qt5
    CMake Error at miniqt/5.14.1/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
      Failed to find "GL/gl.h" in "/usr/include/libdrm".
    Call Stack (most recent call first):
      miniqt/5.14.1/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:207 (include)
      miniqt/5.14.1/gcc_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:100 (find_package)
      miniqt/5.14.1/gcc_64/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
      config/qt.cmake:23 (find_package)
      CMakeLists.txt:204 (AddQtSupport)
    -- Configuring incomplete, errors occurred!
    See also "/home/d/projects/installer-test/node_modules/@nodegui/nodegui/build/CMakeFiles/CMakeOutput.log".
    ERR! OMG Process terminated: 1
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! @nodegui/[email protected] build:addon: `cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the @nodegui/[email protected] build:addon script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/d/.npm/_logs/2020-10-01T17_31_13_312Z-debug.log
    npm WARN [email protected] No description
    npm WARN [email protected] No repository field.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! @nodegui/[email protected] postinstall: `cross-env npm run setupqt && (node ./scripts/skip.js || npm run prebuild:install || npm run build:addon)`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the @nodegui/[email protected] postinstall 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/d/.npm/_logs/2020-10-01T17_31_13_735Z-debug.log
    

    Line of note:

    CMake Error at miniqt/5.14.1/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
    Failed to find "GL/gl.h" in "/usr/include/libdrm".

    The /usr/include directory exists and is filled with header files and folders, but /usr/include/libdrm is not among them. This output dump is from my Ubuntu 20.04 development machine, but any fresh Docker container build reports the same issue.