Blizzard / node-rdkafka

Node.js bindings for librdkafka
MIT License
2.08k stars 391 forks source link

npm i node-rdkafka Fails installing on github runner #1042

Closed Alexis01 closed 9 months ago

Alexis01 commented 9 months ago

Environment Information

Steps to Reproduce When I try to install a version of node-rdkafka on a redhat distribution i got the following error.

npm i node-rdkafka --verbose

Output

npm verb cli [
npm verb cli   '/opt/runner/github/.asdf/installs/nodejs/16.14.0/bin/node',
npm verb cli   '/opt/runner/github/.asdf/installs/nodejs/16.14.0/bin/npm',
npm verb cli   'i',
npm verb cli   'node-rdkafka',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@8.3.1
npm info using node@v16.14.0
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/opt/runner/github/.asdf/installs/nodejs/16.14.0/lib/node_modules/npm/npmrc Completed in 1ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:/opt/runner/xxxxxx/.npmrc Completed in 0ms
npm timing config:load:project Completed in 7ms
npm timing config:load:file:/opt/runner/github/.npmrc Completed in 1ms
npm timing config:load:user Completed in 2ms
npm timing config:load:file:/opt/runner/github/.asdf/installs/nodejs/16.14.0/.npm/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 2ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 0ms
npm timing config:load Completed in 18ms
npm timing npm:load:configload Completed in 18ms
npm timing npm:load:setTitle Completed in 0ms
npm timing config:load:flatten Completed in 3ms
npm timing npm:load:display Completed in 6ms
npm verb logfile /opt/runner/github/.npm/_logs/2023-10-03T06_50_[30](yxxxxxxxxx)_974Z-debug-0.log
npm timing npm:load:logFile Completed in 4ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 30ms
npm timing arborist:ctor Completed in 1ms
npm timing arborist:ctor Completed in 0ms
npm timing idealTree:init Completed in 11ms
npm timing idealTree:userRequests Completed in 2ms
npm http fetch GET 200 https://xxxxxx/node-rdkafka 12ms (cache hit)
npm http fetch GET 200 https://xxxxxxx/npm-public/nan 9ms (cache hit)
npm http fetch GET 200 https://xxxxx/npm-public/bindings 14ms (cache hit)
npm timing idealTree:#root Completed in 38ms
npm http fetch GET 200 https://xxxxx/npm-public/file-uri-to-path 5ms (cache hit)
npm timing idealTree:node_modules/node-rdkafka Completed in 13ms
npm timing idealTree:node_modules/bindings Completed in 2ms
npm timing idealTree:node_modules/file-uri-to-path Completed in 0ms
npm timing idealTree:node_modules/nan Completed in 0ms
npm timing idealTree:buildDeps Completed in 55ms
npm timing idealTree:fixDepFlags Completed in 0ms
npm timing idealTree Completed in 69ms
npm timing reify:loadTrees Completed in 69ms
npm timing reify:diffTrees Completed in 1ms
npm timing reify:retireShallow Completed in 0ms
npm timing reify:createSparse Completed in 1ms
npm timing reify:loadBundles Completed in 0ms
npm timing reifyNode:node_modules/bindings Completed in 176ms
npm timing reifyNode:node_modules/file-uri-to-path Completed in 179ms
npm timing reifyNode:node_modules/nan Completed in 211ms
npm timing reifyNode:node_modules/node-rdkafka Completed in 707ms
npm timing reify:unpack Completed in 707ms
npm timing reify:unretire Completed in 0ms
npm timing build:queue Completed in 1ms
npm info run node-rdkafka@2.17.0 install node_modules/node-rdkafka node-gyp rebuild
npm info run node-rdkafka@2.17.0 install { code: 1, signal: null }
npm timing reify:rollback:createSparse Completed in 102ms
npm timing reify:rollback:retireShallow Completed in 0ms
npm timing command:i Completed in 7566ms
npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/opt/runner/github/.asdf/installs/nodejs/16.14.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
npm verb stack     at ChildProcess.emit (node:events:520:28)
npm verb stack     at maybeClose (node:internal/child_process:1092:16)
npm verb stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm verb pkgid node-rdkafka@2.17.0
npm verb Linux 3.10.0-1160.95.1.el7.x86_64
npm verb argv "/opt/runner/github/.asdf/installs/nodejs/16.14.0/bin/node" "/opt/runner/github/.asdf/installs/nodejs/16.14.0/bin/npm" "i" "node-rdkafka" "--verbose"
npm verb node v16.14.0
npm verb npm  v8.3.1
npm ERR! code 1
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory `/opt/runner/xxxxxxx/node_modules/node-rdkafka/build'
npm ERR!   LD_LIBRARY_PATH=/opt/runner/xxxxxxx/node_modules/node-rdkafka/build/Release/lib.host:/opt/runner/xxxxx/node_modules/node-rdkafka/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps; mkdir -p librdkafka; node ../util/configure
npm ERR! checking for OS or distribution... ok (redhatenterpriseserver)
npm ERR! checking for C compiler from CC env... failed
npm ERR! checking for gcc (by command)... ok
npm ERR! checking for C++ compiler from CXX env... failed
npm ERR! checking for C++ compiler (g++)... failed
npm ERR! checking for C++ compiler (clang++)... failed
npm ERR! checking for C++ compiler (c++)... failed (fail)
npm ERR! checking executable ld... ok
npm ERR! checking executable nm... ok
npm ERR! checking executable objdump... ok
npm ERR! checking executable strip... ok
npm ERR! checking executable libtool... failed (disable)
npm ERR! checking executable ranlib... ok
npm ERR! checking for pkgconfig (by command)... ok
npm ERR! checking for install (by command)... ok
npm ERR! checking for GNU ar... ok
npm ERR! checking for PIC (by compile)... ok
npm ERR! checking for GNU-compatible linker options... ok
npm ERR! checking for GNU linker-script ld flag... ok
npm ERR! checking for __atomic_[32](https://xxxxxx/actions/runs/6389650056/job/17341385426#step:3:33) (by compile)... ok
npm ERR! checking for __atomic_64 (by compile)... ok
npm ERR! checking for socket (by compile)... ok
npm ERR! parsing version '0x020200ff'... ok (2.2.0)
npm ERR! checking for librt (by pkg-config)... failed
npm ERR! checking for librt (by compile)... ok
npm ERR! checking for libpthread (by pkg-config)... failed
npm ERR! checking for libpthread (by compile)... ok
npm ERR! checking for c11threads (by pkg-config)... failed
npm ERR! checking for c11threads (by compile)... failed (disable)
npm ERR! checking for libdl (by pkg-config)... failed
npm ERR! checking for libdl (by compile)... ok
npm ERR! checking for zlib (by pkg-config)... ok
npm ERR! checking for libcrypto (by pkg-config)... ok
npm ERR! checking for libssl (by pkg-config)... ok
npm ERR! checking for libsasl2 (by pkg-config)... failed
npm ERR! checking for libsasl2 (by compile)... failed (disable)
npm ERR! checking for libsasl (by pkg-config)... failed
npm ERR! checking for libsasl (by compile)... failed (disable)
npm ERR! checking for libzstd (by pkg-config)... failed
npm ERR! checking for libzstd (by compile)... failed (disable)
npm ERR! checking for libcurl (by pkg-config)... ok
npm ERR! checking for libm (by pkg-config)... failed
npm ERR! checking for libm (by compile)... ok
npm ERR! checking for liblz4 (by pkg-config)... failed
npm ERR! checking for liblz4 (by compile)... failed (disable)
npm ERR! checking for syslog (by compile)... ok
npm ERR! checking for rapidjson (by compile)... failed (disable)
npm ERR! checking for crc32chw (by compile)... ok
npm ERR! checking for regex (by compile)... ok
npm ERR! checking for rand_r (by compile)... ok
npm ERR! checking for strndup (by compile)... ok
npm ERR! checking for strlcpy (by compile)... failed (disable)
npm ERR! checking for strerror_r (by compile)... ok
npm ERR! checking for strcasestr (by compile)... ok
npm ERR! checking for pthread_setname_gnu (by compile)... ok
npm ERR! checking for nm (by env NM)... ok (cached)
npm ERR! checking for python3 (by command)... ok
npm ERR! checking for getrusage (by compile)... ok
npm ERR! 
npm ERR! 
npm ERR! 
npm ERR! make: Leaving directory `/opt/runner/xxxxxxx/node_modules/node-rdkafka/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/opt/runner/github/.asdf/installs/nodejs/16.14.0/bin/node',
npm ERR! gyp verb cli   '/opt/runner/github/.asdf/installs/nodejs/16.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli   'rebuild'
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.0 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - executable path is "/opt/runner/github/.asdf/installs/python/3.8.10/bin/python3"
npm ERR! gyp verb find Python - executing "/opt/runner/github/.asdf/installs/python/3.8.10/bin/python3" to get version
npm ERR! gyp verb find Python - version is "3.8.10"
npm ERR! gyp info find Python using Python version 3.8.10 found at "/opt/runner/github/.asdf/installs/python/3.8.10/bin/python3"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.14.0
npm ERR! gyp verb command install [ '16.14.0' ]
npm ERR! gyp verb install input version string "16.14.0"
npm ERR! gyp verb install installing version: 16.14.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 11
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.14.0
npm ERR! gyp verb build dir attempting to create "build" dir: /opt/runner/xxxxxxxxx/node_modules/node-rdkafka/build
npm ERR! gyp verb build dir "build" dir needed to be created? Yes
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: /opt/runner/xxxxxxxxx/node_modules/node-rdkafka/build/config.gypi
npm ERR! gyp verb config.gypi checking for gypi file: /opt/runner/xxxxxxxxx/node_modules/node-rdkafka/config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: /opt/runner/xxxxxxx/node_modules/node-rdkafka/common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "make"
npm ERR! gyp info spawn /opt/runner/github/.asdf/installs/python/3.8.10/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/runner/github/.asdf/installs/nodejs/16.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/runner/xxxxxxxxxx/node_modules/node-rdkafka/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/runner/github/.asdf/installs/nodejs/16.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/runner/github/.cache/node-gyp/16.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/opt/runner/github/.cache/node-gyp/16.14.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/runner/github/.asdf/installs/nodejs/16.14.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/opt/runner/github/.cache/node-gyp/16.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/opt/runner/xxxxxxxxx/node_modules/node-rdkafka',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir /opt/runner/github/.cache/node-gyp/16.14.0
npm ERR! gyp verb `which` succeeded for `make` /bin/make
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ###########################################################
npm ERR! ###                  Configure failed                   ###
npm ERR! ###########################################################
npm ERR! ### Accumulated failures:                               ###
npm ERR! ###########################################################
npm ERR!  cxx (WITH_CXX) C++ compiler (c++)
npm ERR!     module: cc
npm ERR!     action: fail
npm ERR!     reason:
npm ERR! command 'c++ --version' failed:
npm ERR! mklove/modules/configure.base: line 1824: c++: command not found
npm ERR! 
npm ERR! make: *** No rule to make target `../deps/librdkafka/config.h', needed by `11a9e[33](https://xxxxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:34)88a67e1ca5c31c1d8da49cb6d2714eb[41](https://xxxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:42).intermediate'.  Stop.
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/opt/runner/github/.asdf/installs/nodejs/16.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 3.10.0-1160.95.1.el7.x86_64
npm ERR! gyp ERR! command "/opt/runner/github/.asdf/installs/nodejs/16.14.0/bin/node" "/opt/runner/github/.asdf/installs/nodejs/16.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /opt/runner/xxxxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:46)1869/sanes-vostok-test_angular11-app-x4[51](https://xxxxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:52)869/node_modules/node-rdkafka
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm verb exit 1
npm timing npm Completed in 7790ms
npm verb unfinished npm timer reify 169631[58](https://xxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:59)31191
npm verb unfinished npm timer reify:build 169[63](https://xxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:64)15831979
npm verb unfinished npm timer build 1[69](https://xxxxxxx/actions/runs/6389650056/job/17341385426#step:3:70)63158319[80](https://xxxxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:81)
npm verb unfinished npm timer build:deps 1696315831980
npm verb unfinished npm timer build:run:install 16963158319[81](https://xxxxxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:82)
npm verb unfinished npm timer build:run:install:node_modules/node-rdkafka 1696315[83](https://xxxxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:84)1[98](https://xxxxxxxxxxx/actions/runs/6389650056/job/17341385426#step:3:99)1
npm verb code 1

Can you help me to understand what is wrong ?

everhardt commented 4 months ago

Could you tell how you solved this?