backstage / backstage

Backstage is an open framework for building developer portals
https://backstage.io/
Apache License 2.0
28.63k stars 6.09k forks source link

🐛 Bug Report: Latest spectral-core dependency has very specific node version requirements #27819

Open jslott2sigma opened 1 week ago

jslott2sigma commented 1 week ago

📜 Description

In Backstage 1.33.4, the @stoplight/spectral-core dependency version (1.18.0) has a very specific set of node versions it wants. From this PR in their repo, the aim to remove support for node 12/14 resulted in the following required node version:

"node": "^16.20 || ^18.18 || >= 20.17"

If we do not have those specific versions, a yarn versions:bump will fail.

error @stoplight/spectral-core@1.19.4: The engine "node" is incompatible with this module. Expected version "^16.20 || ^18.18 || >= 20.17". Got "20.14.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

👍 Expected behavior

Yarn should succeed with the same allowable versions of node that Backstage requires

👎 Actual Behavior with Screenshots

If we do not have those specific versions, a yarn versions:bump will fail.

error @stoplight/spectral-core@1.19.4: The engine "node" is incompatible with this module. Expected version "^16.20 || ^18.18 || >= 20.17". Got "20.14.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

👟 Reproduction steps

Run yarn versions:bump while having an earlier version of node installed (in my case node 20.14).

📃 Provide the context for the Bug.

No response

🖥️ Your Environment

No response

👀 Have you spent some time to check if this bug has been raised before?

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

None

jslott2sigma commented 1 week ago

For now, I'm going to try resolutions in my package.json to use an older version of spectral-core to see if that solves the problem.

Rugvip commented 5 days ago

@jslott2sigma are you able to move to a more recent minor release of Node.js v20? We also generally expect that a fairly recent minor release of each major release is being used. Current minor is .18 though, so >= .17 is quite strict. Thank you for opening https://github.com/stoplightio/spectral/issues/2747 btw 🙏, I think that's the proper fix