Nazreen Mohamad
AWS Architech
Published in
2 min readAug 4, 2020

--

Tooling: How to upgrade the AWS CDK CLI

Maybe you installed it a while back, and now you suddenly run into an error complaining about the need to upgrade the CDK CLI. You don’t even remember how you installed it in the first place — that’s why you googled ‘how to upgrade CDK CLI’ just now. Welcome to the right place, the right post, that will quickly tell you how to upgrade your AWS CDK CLI.

If you run into the above error, “This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version.” then that means you need to upgrade your CDK CLI version.

Here’s how you can do it. The exact command would vary based on which package manager you use.

  1. First of all, make sure you’re aware of breaking changes between your current version and the latest version. Check the CDK CLI releases page on github: https://github.com/aws/aws-cdk/release for this.
  2. Update the CDK package to the latest version.

If using npm : npm install -g aws-cdk@latest.

using npm

If using yarn: yarn global upgrade aws-cdk (thanks to Daniel Hagen for this yarn command).

--

--