aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.66k stars 3.92k forks source link

cloud-assembly-schema: incompatible version of Node.js #31237

Closed sakurai-ryo closed 1 month ago

sakurai-ryo commented 2 months ago

Describe the bug

Hi Team,

After this PR was merged, the aws-cdk-lib now uses the cloud-assembly-schema that was externally published. https://github.com/aws/aws-cdk/pull/31064

Previously, >= 14.15.0 was specified in engines in package.json, but now >= 18.18.0 is specified and the compatible version was updated.

Before: https://github.com/aws/aws-cdk/blob/5f30aa5f81ef823422e994563cefc9e8a15e82f8/packages/%40aws-cdk/cloud-assembly-schema/package.json#L108

Now:

  "engines": {
    "node": ">= 18.18.0"
  },

https://github.com/cdklabs/cloud-assembly-schema/blob/7468c327aa0b0ef46c4b971ac36278ef57fb2b8b/package.json#L81

This may cause errors when installing or updating aws-cdk-lib if you are using a version of Node.js lower than 18.18.0. You can ignore Node.js version compatibility with the --ignore-engines option in yarn, but this is a something to avoid if at all possible.

Regression Issue

Last Known Working CDK Version

v2.154.1

Expected Behavior

The installation and upgrade of aws-cdk-lib should work without errors or warnings.

Current Behavior

In the case of yarn, you will get the following error. error @aws-cdk/cloud-assembly-schema@36.0.19: The engine "node" is incompatible with this module. Expected version ">= 18.18.0". Got "18.17.0"

Reproduction Steps

Using a version of Node.js lower than 18.18.0, execute the following command.

$ yarn add aws-cdk-lib@2.154.1

Possible Solution

If there is no obvious reason to require a version higher than 18.18.0, specify >= 14.15.0 for engins, as with aws-cdk-lib.

Additional Information/Context

No response

CDK CLI Version

v2.154.1

Framework Version

v2.154.1

Node.js Version

18.17.0

OS

macos

Language

TypeScript

Language Version

No response

Other information

No response

ashishdhingra commented 2 months ago

Reproducible.

Tested on OSX:

Output:

[1/4] 🔍  Resolving packages...
warning jest > jest-cli > jest-config > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > jest-cli > jest-config > glob > 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.
warning jest > @jest/core > @jest/transform > babel-plugin-istanbul > test-exclude > glob@7.2.3: Glob versions prior to v9 are no longer supported
[2/4] 🚚  Fetching packages...
error @aws-cdk/cloud-assembly-schema@36.0.20: The engine "node" is incompatible with this module. Expected version ">= 18.18.0". Got "16.20.2"
error Found incompatible module.
sakurai-ryo commented 2 months ago

@ashishdhingra I think this issue needs to be discussed by the core team, is it OK if I leave it to you?

sakurai-ryo commented 1 month ago

This issue was fixed. https://github.com/cdklabs/cloud-assembly-schema/pull/59

github-actions[bot] commented 1 month ago

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.