How to solve CDK CLI version mismatch

We Are Going To Discuss About How to solve CDK CLI version mismatch. So lets Start this Python Article.

How to solve CDK CLI version mismatch

  1. How to solve How to solve CDK CLI version mismatch

    I encountered this issue with a typescript package, after upgrading the cdk in package.json. As Maciej noted upgrading did not seem to work. I am installing the cdk cli with npm, and an uninstall followed by an install fixed the issue.
    npm -g uninstall aws-cdk npm -g install aws-cdk

  2. How to solve CDK CLI version mismatch

    I encountered this issue with a typescript package, after upgrading the cdk in package.json. As Maciej noted upgrading did not seem to work. I am installing the cdk cli with npm, and an uninstall followed by an install fixed the issue.
    npm -g uninstall aws-cdk npm -g install aws-cdk

Solution 1

I encountered this issue with a typescript package, after upgrading the cdk in package.json. As Maciej noted upgrading did not seem to work. I am installing the cdk cli with npm, and an uninstall followed by an install fixed the issue.

npm -g uninstall aws-cdk
npm -g install aws-cdk

Original Author user113420 Of This Content

Solution 2

So I’ve fixed it, but is too chaotic to describe the steps.

It seems like there are problems with the symlink

/usr/local/bin/cdk

which was pointing to version 1.85.0 and not the one I updated to 1.92.0.

I removed the aws-cdk from the node_modules and installed it again, then removed the symlink /usr/local/bin/cdk and recreated it manually with

ln -s /usr/lib/node_modules/aws-cdk/bin/cdk /usr/local/bin/cdk

Original Author edited May 3, 2021 at 4:49 Of This Content

Solution 3

nothing helps for mac OS except this command:

yarn global upgrade [email protected]

Original Author CloudA2Z Of This Content

Solution 4

I have been experiencing this a few times as well, so i am just dropping this solution which helps me resolves version mismatches, particularly on existing projects.

For Python:

What you need to do is modify the setup.py to specify the latest version.

Either, implicitly

    install_requires=[
    "aws-cdk.core",
    "aws-cdk.aws-ec2",
    "aws-cdk.aws_ecs",
    "aws-cdk.aws_elasticloadbalancingv2"
],

or explicitly;

    install_requires=[
    "aws-cdk.core==1.xx.x",
    "aws-cdk.aws-ec2==1.xx.x",
    "aws-cdk.aws_ecs==1.xx.x",
    "aws-cdk.aws_elasticloadbalancingv2==1.xx.x"
],

Then from project root, run;

setup.py install

For TypeScript:

Modify package.json;

"dependencies": {
    "@aws-cdk/core" : "latest",
    "source-map-support": "^0.5.16"
  }

Then run from project root:

npm install

I hope this helps! Please let me know if I need to elaborate or provide more details.

Original Author user2818782 Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment