Skip to content

typescript ^5 peer dependency blocks installing the CLI as a devDependency in TypeScript 6/7 projects #2822

Closed

Description

@kid7st

Description

@aws/agentcore 1.0.3 declares "peerDependencies": { "typescript": "^5" }. A project that uses TypeScript 6 or 7 therefore cannot add the CLI as a devDependency, which is the usual way to pin a CLI's version for every developer and for CI:

$ npm install -D @aws/[email protected]      # in a project with "typescript": "^7.0.2"
npm error While resolving: agent@undefined
npm error Found: [email protected]
npm error Could not resolve dependency:
npm error peer typescript@"^5" from @aws/[email protected]

The only workarounds are --legacy-peer-deps / --force, an overrides entry, or running the CLI outside the project (npx -y @aws/[email protected] …, or a global install).

As far as I can see, the CLI never loads typescript itself: no module under src/ imports or resolves it, outside templates and tests. The CDK app it generates declares its own typescript (~5.9.3 in agentcore/cdk/package.json) and compiles with that, so the peer requirement on the host project looks unnecessary.

Acceptance Criteria

  • npm install -D @aws/agentcore succeeds in a project whose own typescript is 6.x or 7.x.
  • Either the typescript peer dependency is removed, or it is optional (peerDependenciesMeta) and covers the versions the CLI supports.

Additional Context

We hit this while integrating the AgentCore CLI into a framework whose scaffolded projects use TypeScript 7. npx -y @aws/[email protected] deploy from a clean checkout works fine, after npm ci --prefix agentcore/cdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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