Skip to content

agentcore create fails — aws-cdk-lib version in CDK template incompatible with @aws/agentcore-cdk peer dependency #584

@mikegc-aws

Description

@mikegc-aws

Severity: High — blocks all new project creation

Description

Running agentcore create fails during the "Prepare agentcore/ directory" step with an ERESOLVE error. npm install cannot resolve the dependency tree because the CDK template's package.json pins aws-cdk-lib to a version that doesn't satisfy the peer dependency required by @aws/agentcore-cdk.

Root Cause

The template at dist/assets/cdk/package.json specifies:

"aws-cdk-lib": "2.239.0"

However, @aws/agentcore-cdk@0.1.0-alpha.9 (resolved from the ^0.1.0-alpha.1 range in the same template) declares a peer dependency of:

"aws-cdk-lib": "^2.243.0"

Since 2.239.0 does not satisfy ^2.243.0, npm fails.

Steps to Reproduce

  1. Run agentcore create with any project name
  2. Observe failure at the "Prepare agentcore/ directory" step

Error Output

npm error ERESOLVE unable to resolve dependency tree
npm error peer aws-cdk-lib@"^2.243.0" from @aws/agentcore-cdk@0.1.0-alpha.9
npm error   aws-cdk-lib@"2.239.0" from the root project

Suggested Fix

Update aws-cdk-lib in dist/assets/cdk/package.json (and the source template it's built from) to at least 2.243.0. Going forward, consider keeping this version in sync with the minimum peer dependency declared by @aws/agentcore-cdk, or using a compatible range (e.g. ^2.243.0) instead of a pinned version to avoid this class of issue recurring on future @aws/agentcore-cdk releases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions