Skip to content

cli: cdk init does not generate package.json with the latest aws-cdk-lib #946

@tmokmss

Description

@tmokmss

Describe the bug

Hi, I noticed the package.json generated by the latest CDK CLI uses some old aws-cdk-lib version.

  "devDependencies": {
    "@types/jest": "^29.5.14",
    "@types/node": "22.7.9",
    "aws-cdk": "2.1031.1",
    // ...
  },
  "dependencies": {
    "aws-cdk-lib": "2.215.0",  // the latest is 2.221.1 at the moment
    "constructs": "^10.0.0",

Is it an expected behavior? I feel it should be the latest aws-cdk-lib version.

In addition, it specifies a pinned version (e.g. "2.215.0"), making it impossible to update it with single npm update command.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Library Version

No response

Expected Behavior

A project generated by cdk init with the latest CDK CLI uses the latest supported aws-cdk-lib version.

Current Behavior

It uses some old aws-cdk-lib version.

Reproduction Steps

Run npx cdk@latest init --language=typescript.

Possible Solution

As far as I understand, a aws-cdk package version has a range of supported aws-cdk-lib versions (ref). It should point to the latest supported version by default.

Additional Information/Context

No response

AWS CDK Library version (aws-cdk-lib)

N/A

AWS CDK CLI version

2.1031.1

Node.js Version

22

OS

macOS

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions