Only upgraded to CDK 1.10.0 and tried to run cdk diff command
CDK CLI can only be used with apps created by CDK >= 1.10.0
This is :bug: Bug Report
I also tried npm install -g [email protected] but still get the same error when trying to run a cdk diff not sure why since cdk --version shows 1.9.0 or where that is happening.
The version check for Node/Typescript is coming from a package named @aws-cdk/cx-api. The check is in a file called versioning.js (path: aws-cdk\node_modules\@aws-cdk\cx-api\lib). The check appears to read the manifest file in the cdk.out folder, the version in my manifest.json is always being generated as 0.36.0; therefore I am getting the same issue using aws-cdk 1.10.0 with Node/Typescript.
@btotharye
I think this is also a bug with the Node/Typescript CDK. With regards to the Node/Typescript library aws-cdk version 1.9.0 has package.json file which includes an optimistic version constraint of ^1.9.0 on the @aws-cdk/cx-api package. This means it will will match against all versions greater than 1.x.x
If you go to https://semver.npmjs.com/ and enter a package name of @aws-cdk/cx-api and range ^1.9.0 you'll see that ^1.9.0 also matches 1.10.0.
The only "fix" I found was to take the @aws-cdk in my local node modules and copy it into my npm global package store!
For Python, I'm not so sure.
The version check is coming from a package named @aws-cdk/cx-api. The check is in a file called versioning.js (path: aws-cdk\node_modules@aws-cdk\cx-api\lib). The check appears to read the manifest file in the cdk.out folder, my version is always being generated as 0.36.0.
@btotharye
It looks like the aws-cdk version 1.9.0 has package.json file which includes an optimistic version constraint of @awd-cdk/cx-api of ^1.9.0. This means it will will match against all version 1.x.xIf you go to https://semver.npmjs.com/ and enter a package name of @aws-cdk/cx-api and range ^1.9.0 you'll see that ^1.9.0 also matches 1.10.0.
The only "fix" I found was to take the @aws-cdk in my local node modules and copy it into my npm global package store!
Cool thanks for the info
I also seen this issue earlier today. I found it to be the aws-cdk core was not at the correct version and even after changing the pip install to use the latest it did not update.
I manually set the pip install of each package to use 1.10.0 and then everything worked as expected.
Hope this helps!
For Typescript I removed the node_modules directory and executed npm install to include all the new dependencies with the new CDK version.
@btotharye I suggest removing "language/python" tag from the bug as the issue is not language-specific. I ran into it today while using .NET CDK. Not having the tag may communicate better the breadth of negative impact this issue is having.
A solution to this problem is to upgrade _all_ of your CDK library dependencies to 1.10.0 or greater.
A solution to this problem is to upgrade _all_ of your CDK library dependencies to
1.10.0or greater.
As a work-around this worked, although breaking changes in 1.10 caused lengthy regression effort today.
Maybe a better solution would be to use the locally installed CDK (npx cdk diff) instead of installing it globally? I'm not sure why this isn't recommended in the README.
I was able to resolve this issue by upgrading like this.
npm install -g [email protected]
well to anybody having the came issue there is a cdk command in package.json for a reason. Just use that since it will always be inline with your local cdk version ie: yarn cdk synth
Most helpful comment
A solution to this problem is to upgrade _all_ of your CDK library dependencies to
1.10.0or greater.