confluentinc / confluent-kafka-javascript

Confluent's Apache Kafka JavaScript client
https://www.npmjs.com/package/@confluentinc/kafka-javascript
MIT License
80 stars 6 forks source link

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

Open justjake opened 5 days ago

justjake commented 5 days ago

Environment Information

Steps to Reproduce

$ 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 commented 4 days ago

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 commented 2 days ago

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

milindl commented 1 day ago

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

Claimundefine commented 1 day ago

https://github.com/confluentinc/confluent-kafka-javascript/pull/163 Downgraded lru-cache to the latest legacy version compatible with node 18.