aws-cdk: ‼️ NOTICE: aws-cdk CLI - "Cloud assembly schema version mismatch: Maximum schema version supported is 10.0.0, but found 11.0.0"
Please add your +1 👍 to let us know you have encountered this
Status: IN-PROGRESS
This is a bug in npm version 7 only (npm versions 6 and below work fine). See here for details: https://github.com/npm/cli/issues/3196
Overview:
After upgrading the CDK CLI package (aws-cdk) with npm version 7, running any CDK command in your CDK application fails with the error Cloud assembly schema version mismatch: Maximum schema version supported is 10.0.0, but found 11.0.0.
Complete Error Message
$ npx cdk ls
This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version.
(Cloud assembly schema version mismatch: Maximum schema version supported is 10.0.0, but found 11.0.0)
Workaround:
Please remove the installed aws-cdk package, and then install it again:
$ npm uninstall -g aws-cdk
$ npm install -g aws-cdk
Original opening post
This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version. (Cloud assembly schema version mismatch: Maximum schema version supported is 10.0.0, but found 11.0.0)
aws-cdk version 1.103.0 and 1.104.0 do not work. aws-cdk version 1.102.0 works fine
Reproduction Steps
Install aws-cdk 1.103.0 (or 1.104.0) pip install -r requirements.txt
cdk ls
What did you expect to happen?
List of stacks displayed
What actually happened?
"This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version. (Cloud assembly schema version mismatch: Maximum schema version supported is 10.0.0, but found 11.0.0) "
Environment
- CDK CLI Version : 1.104.0
- Framework Version: 1.103.0 & 1.104.0
- Node.js Version: v16.1.0
- **OS : Mac Big Sur
- Language (Version): Python 3.8.7
Other
This is 🐛 Bug Report
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 117
- Comments: 52 (27 by maintainers)
Commits related to this issue
- update alpine 3.13 -> 3.15, cdk 0.105.0 -> 1.134.0 This brings the image to the latest versions of alpine and cdk. I needed to do this because I encountered this bug in aws-cdk: https://github.com/... — committed to thalesmg/docker-aws-cdk by thalesmg 3 years ago
- update alpine 3.13 -> 3.15, cdk 1.105.0 -> 1.134.0 This brings the image to the latest versions of alpine and cdk. I needed to do this because I encountered this bug in aws-cdk: https://github.com/... — committed to thalesmg/docker-aws-cdk by thalesmg 3 years ago
- fix(run): update aws-cdk This updates the base image and the python lib versions. I needed to do this because I encountered this bug in aws-cdk: https://github.com/aws/aws-cdk/issues/14738 Just do... — committed to emqx/cdk-emqx-cluster by thalesmg 3 years ago
- fix(run): update aws-cdk This updates the base image and the python lib versions. I needed to do this because I encountered this bug in aws-cdk: https://github.com/aws/aws-cdk/issues/14738 Just do... — committed to emqx/cdk-emqx-cluster by thalesmg 3 years ago
- fix(run): update aws-cdk This updates the base image and the python lib versions. I needed to do this because I encountered this bug in aws-cdk: https://github.com/aws/aws-cdk/issues/14738 Just do... — committed to emqx/cdk-emqx-cluster by thalesmg 3 years ago
- fix(run): update aws-cdk This updates the base image and the python lib versions. I needed to do this because I encountered this bug in aws-cdk: https://github.com/aws/aws-cdk/issues/14738 Just do... — committed to emqx/cdk-emqx-cluster by thalesmg 3 years ago
This is because schema version 16.0.0 was introduced in CDK 1.139. CDKv2 does not support it yet as of 2.5.0.
Solutions:
Best I can recommend at this moment is trying:
And seeing if that fixes it.
NPM left your install in an inconsistent state, and without being able to reproduce it it’s hard to say why.
Hello,
This is for future reference. I’m using CDK to deploy a pipeline stack in one account, then have that account (
deploy-account) deploy on my behalf to other accounts (dev,prod, etc.)I’m using TS for the CDK and have installed
aws-cdk. node version:v16.14.0npm version: v8.3.1cdk --version:v2.45.0`Locally, everything was fine when doing
cdk synthandcdk ls.When I deploied to my
deploy-accountI was exevutingnpx cdk synthas described in the docs. Then I was getting this error.I tried:
As suggested, but it didn’t worked for me.
What I did was:
After, when I redeployied it worked 🤷♂️
Hope it helps,
Thank you so much. I suffered a lot until follow your guide by uninstalling/installing.
Oh well I might know what it is.
npx cdkhappens to use whatevercdkit finds on the$PATH, if available.What about:
?
For me, the issue was that I had my
dependenciesusing version:1.124.0but mydevDependencieswere using1.117.0. Changing that fixed it for me.From the logs here this looks like a genuine problem but I want to present another data point. Please review your config. Make sure you have not done something like what I had done in my project.
It’ll keep working perfectly fine until one day all the other dependencies are updated and
aws-cdkis not compatible anymore and then you get this error.Upgrading the package is not a solution. This will happen again.
Why does
aws-cdktake a dependency onaws-cdk-libfor Cloud Assembly versions, but not declare that dependency inpackage.jsonas a peer dependency? If a version ofaws-cdkonly supports generating up to version 10, but the library needs version 11, then there should be a dependency relationship between the two.I upgraded my node version to the latest - v20.10.0 (with npm 10.2.3). Then, reinstalled the aws-cdk. Updated package.json to use the latest
aws-cdkandaws-cdk-lib. This fixed my issue.I am using hte following dependencies:
Have you tried a complete uninstall of aws-cdk and a re-install. That ‘fixed’ it for me
OK, I was playing with this all day, and, while I’m not sure why this happens, I have been able to consistently reproduce this error with NPM 7. It manifests itself with local installs the same as with global installs.
This is a sequence in a CDK project created with
1.105.0that doesn’t have apackage.jsonitself (for example, a Java/Python CDK project):Clearly, the
@aws-cdk/cx-apipackage stays at1.98.0, instead of being updated to1.105.0.