discord.js icon indicating copy to clipboard operation
discord.js copied to clipboard

Updated @discordjs/[email protected] breaks node16 compatility (EBADENGINE)

Open crycode-de opened this issue 1 year ago • 6 comments

Which package is this bug report for?

discord.js

Issue description

When installing recent version of discord.js on node 16 an unsupported engine warning will be shown as of the the automatically installed package @discordjs/[email protected] requires node >= 18.

user@host:/tmp/tmp.8sXz0qWtWM$ npm i discord.js
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@discordjs/[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@discordjs/[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }

As of the package.json from discord.js it should be compatible with node >=16.11.0 so all depended packages of the discord.js packages should not require a higher version.

This issue breaks for example automated pipeline checks here and didn't happen about 3 weeks ago.

Code sample

No response

Versions

  • discord.js 14.14.1
  • Node: 16.20.2

Output of npm ls @discordjs/collection:

└─┬ [email protected]
  ├── @discordjs/[email protected]
  ├─┬ @discordjs/[email protected]
  │ └── @discordjs/[email protected]
  └─┬ @discordjs/[email protected]
    └── @discordjs/[email protected]

Issue priority

Low (slightly annoying)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

Not applicable

I have tested this issue on a development release

d0aa8d25e

crycode-de avatar Nov 27 '23 10:11 crycode-de

That is intended, Node.js v16 is EOL (End-of-Life) and therefore discouraged from further use, you should start migrating to Node.js v18 or v20 as soon as possible. https://nodejs.org/en/about/previous-releases

kyranet avatar Nov 27 '23 10:11 kyranet

I know that node 16 is EOL but such a breaking change should not be done in a minor or patch release as it would break any existing installation. Some users don't want to or can't update node at the moment.

If node 18 is required for discord.js (as it is currently by it's dependencies) this should be a major version increase for discord.js.

In the current situation you are saying "Node.js 16.11.0 or newer is required." but require node 18 by @discordjs/collection dependeny. This makes no sense.

crycode-de avatar Nov 27 '23 10:11 crycode-de

Discord.js imports @discordjs/[email protected], whereas we've released v2.0 with this requirement. Can you run npm ls @discordjs/collection to see where its coming from?

EDIT: I see where its coming from, which is the internal packages. Realistically, the warning doesn't stop anything and it'll still work.

vladfrangu avatar Nov 27 '23 11:11 vladfrangu

@vladfrangu It's coming from @discordjs/rest and @discordjs/ws as already shown in my first post.

crycode-de avatar Nov 27 '23 12:11 crycode-de

Yeah it's unfortunate but it functionally doesn't matter. I doubt there's really anything we could implement to collection to actually cause this to break.

didinele avatar Nov 27 '23 13:11 didinele

zlib-sync

insaneMe31 avatar Dec 02 '23 12:12 insaneMe31

Considering with the latest release we effectively also require node 18, this issue isn't relevant anymore.

didinele avatar May 05 '24 18:05 didinele