cloud-assembly-schema: incompatible version of Node.js
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
- [ ] Select this option if this issue appears to be a regression.
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/[email protected]: 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 [email protected]
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
Reproducible.
Tested on OSX:
- Install node using command
brew install node@16.- Add node to PATH using command
echo 'export PATH="/opt/homebrew/opt/node@16/bin:$PATH"' >> ~/.zshrc.
- Add node to PATH using command
- In a CDK project, try executing
yarn add [email protected]
Output:
[1/4] 🔍 Resolving packages...
warning jest > jest-cli > jest-config > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > jest-cli > jest-config > glob > [email protected]: 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 > [email protected]: Glob versions prior to v9 are no longer supported
[2/4] 🚚 Fetching packages...
error @aws-cdk/[email protected]: The engine "node" is incompatible with this module. Expected version ">= 18.18.0". Got "16.20.2"
error Found incompatible module.
@ashishdhingra I think this issue needs to be discussed by the core team, is it OK if I leave it to you?
This issue was fixed. https://github.com/cdklabs/cloud-assembly-schema/pull/59
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.