question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Npm install fails with latest node-rdkafka & node <= v10

See original GitHub issue

Using Node v10.0, I get the following error when running an npm install on a project with node-rdkafka@2.9.0:

make[2]: Leaving directory `/home/kit/dev/noderdkafkatest/node_modules/node-rdkafka/deps/librdkafka/examples'
Updating CONFIGURATION.md
CONFIGURATION.md CONFIGURATION.md.tmp differ: byte 418, line 6
Installing documentation to /home/kit/dev/noderdkafkatest/node_modules/node-rdkafka/build/deps
install -d $DESTDIR/home/kit/dev/noderdkafkatest/node_modules/node-rdkafka/build/deps/share/doc/librdkafka
install LICENSE LICENSES.txt INTRODUCTION.md README.md CONFIGURATION.md STATISTICS.md $DESTDIR/home/kit/dev/noderdkafkatest/node_modules/node-rdkafka/build/deps/share/doc/librdkafka
make[1]: Leaving directory `/home/kit/dev/noderdkafkatest/node_modules/node-rdkafka/deps/librdkafka'
  TOUCH Release/obj.target/deps/librdkafka.stamp
  CXX(target) Release/obj.target/node-librdkafka/src/binding.o
../src/binding.cc: In function ‘void Init(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’:
../src/binding.cc:81:28: error: ‘GetCurrentEnvironment’ is not a member of ‘node’
   node::Environment* env = node::GetCurrentEnvironment(context);
                            ^
make: *** [Release/obj.target/node-librdkafka/src/binding.o] Error 1
rm deps_librdkafka_gyp_librdkafka_target_build_dependencies.intermediate
make: Leaving directory `/home/kit/dev/noderdkafkatest/node_modules/node-rdkafka/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/kit/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Linux 3.10.0-1062.12.1.el7.x86_64
gyp ERR! command "/home/kit/.nvm/versions/node/v10.0.0/bin/node" "/home/kit/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/kit/dev/noderdkafkatest/node_modules/node-rdkafka
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN noderdkafkatest@1.0.0 No description
npm WARN noderdkafkatest@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-rdkafka@2.9.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-rdkafka@2.9.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/kit/.npm/_logs/2020-06-16T13_03_15_567Z-debug.log

The debug log didn’t seem to contain any info on the error.

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: RHEL 7.7 (Maipo) amd64 (also seen on MacOS)
  • Node Version [e.g. 8.2.1]: v10.0 & v11.0
  • NPM Version [e.g. 5.4.2]: 6.4.1
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]: g++
  • node-rdkafka version [e.g. 2.3.3]: 2.9.0

Steps to Reproduce

  1. Set node version to v10.0
  2. Create a simple node project with node-rdkafka@2.9.0 as a dependency
  3. Run npm install. It fails with the above error.
  4. Set node version to v11.0 5 Rerun npm install. It completes.

node-rdkafka Configuration Settings Default.

Additional context nvm was used to change the node versions Also fails on node v.9.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

2reactions
iradulcommented, Jul 23, 2020

I published a new version (v2.9.1) that should fix this.

1reaction
iradulcommented, Jul 20, 2020

docker run --rm -ti node:11.0 bash -c 'echo "Node version $(node -v)" && npm i node-rdkafka'

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM install node-rdkafka fails with node-gyp rebuild error
Failed at the node-rdkafka@2.7.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output ...
Read more >
node-rdkafka - npm
This library includes two utility functions for detecting the status of your installation. Please try to include these when making issue reports ...
Read more >
Installing node-rdkafka on M1 for use with SASL
Here's a short, step by step guide on installing the node-rdkafka client ... librdkafka and into your Node.js project directory.
Read more >
T158617 npm install fails for changeprop service in MW ...
_handle.onexit (internal/child_process.js:211:12) gyp ERR! ... Failed at the node-rdkafka@0.6.4 install script 'node-gyp rebuild'. npm ERR!
Read more >
Solving common issues with node-gyp - LogRocket Blog
node -gyp, short for generate your projects, is a tool that lets us build native add-ons for Node.js. Due to historical reasons, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found