Using Node v10.0, I get the following error when running an npm install on a project with [email protected]:
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 [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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
Steps to Reproduce
npm install. It fails with the above error.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
I see this happening with Node 9 however LTS versions (including 10) are working fine.
docker run -ti --rm -w /test node:10 npm i node-rdkafka
@iradul Thx, yes I've just tried it on earlier LTSes. 4.91 & 8.17.0 both work fine.
Maybe this needs to be clarified in the docs?
I think we can easily fix this for Node 9.
Node 10, less then 10.16.0 also doesn't compile (#807).
I've tested 11.0.0 and 12.0.0, both looking good.
Hi @iradul I'm currently seeing this error with node 11.0.0
'GetCurrentEnvironment' is not a member of 'node'
node::Environment* env = node::GetCurrentEnvironment(context);
docker run --rm -ti node:11.0 bash -c 'echo "Node version $(node -v)" && npm i node-rdkafka'
@iradul That works for me, thanks.
@iradul what is the latest version that is supported on Node 10, less than 10.16.0? I'm running node v10.13.0 LTS and can confirm I also got this issue.
@iradul what is the latest version that is supported on Node 10, less than 10.16.0? I'm running node v10.13.0 LTS and can confirm I also got this issue.
It seems like at node-rdkafka
I published a new version (v2.9.1) that should fix this.
Most helpful comment
I published a new version (
v2.9.1) that should fix this.