Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@confluent/kafka-javascript@0.4.0 not compatible with Node 18 #152

Closed
justjake opened this issue Nov 12, 2024 · 6 comments
Closed

@confluent/kafka-javascript@0.4.0 not compatible with Node 18 #152

justjake opened this issue Nov 12, 2024 · 6 comments
Labels
bug Something isn't working fixed-present-in-next-release Bug or improvement that's done, it is in the development branch but yet unreleased

Comments

@justjake
Copy link

justjake commented Nov 12, 2024

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: Mac
  • Node Version [e.g. 8.2.1]: 18.17.0
  • NPM Version [e.g. 5.4.2]: 9.6.7
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]: N/A
  • confluent-kafka-javascript version [e.g. 2.3.3]: 0.4.0

Steps to Reproduce

  • Use Node 18.x
  • Attempt to install v0.4.0
$ npm i
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: lru-cache@11.0.2
npm ERR! notsup Not compatible with your version of node/npm: lru-cache@11.0.2
npm ERR! notsup Required: {"node":"20 || >=22"}
npm ERR! notsup Actual:   {"npm":"9.6.7","node":"v18.17.0"}

Package lru-cache@11 doesn't support Node 18. I suggest you downgrade your requirement to lru-cache 10, and use CI to run npm install on a matrix of your supported platforms to prevent similar regressions in the future.

@milindl
Copy link
Contributor

milindl commented Nov 12, 2024

Hey @justjake , is the install failing due to this? I checked with node 18, and though I get a similar error, the installation actually works fine for me:

$ npm install @confluentinc/kafka-javascript
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'lru-cache@11.0.2',
npm warn EBADENGINE   required: { node: '20 || >=22' },
npm warn EBADENGINE   current: { node: 'v18.20.4', npm: '10.7.0' }
npm warn EBADENGINE }
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated gauge@3.0.2: This package is no longer supported.

$ node
 node
Welcome to Node.js v18.20.4.
Type ".help" for more information.
> a = new require('@confluentinc/kafka-javascript').Producer({ 'bootstrap.servers': 'localhost:9092' })
Producer {
....

In any case, I do plan to address this to stop this issue (I think I might just drop it from the kafka client).

I did plan to do a post-release installation to verify it's working across platforms, I've just not gotten around to doing it yet.

@justjake
Copy link
Author

Having the package in package.json causes CI to fail.

@milindl
Copy link
Contributor

milindl commented Nov 15, 2024

We've removed extra packages (including lru-cache) from the Kafka client with #162 , it should be fixed when we make the next release.

@milindl milindl added bug Something isn't working fixed-present-in-next-release Bug or improvement that's done, it is in the development branch but yet unreleased labels Nov 15, 2024
@Claimundefine
Copy link
Contributor

#163 Downgraded lru-cache to the latest legacy version compatible with node 18.

@justjake
Copy link
Author

Hi, we've begun experiencing crashes in production due to an assertion fixed in upstream rdkafka here: confluentinc/librdkafka#4833

It would be great for 0.4.1 to hit NPM as soon as possible so we can upgrade

@milindl
Copy link
Contributor

milindl commented Nov 26, 2024

Fixed with 0.5.2 which has the latest version of librdkafka

@milindl milindl closed this as completed Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed-present-in-next-release Bug or improvement that's done, it is in the development branch but yet unreleased
Projects
None yet
Development

No branches or pull requests

3 participants