Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-lambda-python-alpha): npm install fails due to dependency conflict with aws-cdk-lib #26003

Closed
wong-a opened this issue Jun 16, 2023 · 4 comments
Labels
@aws-cdk/aws-lambda-python bug This issue is a bug. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@wong-a
Copy link
Contributor

wong-a commented Jun 16, 2023

Describe the bug

aws-lambda-python-alpha cannot be installed in a CDK JavaScript app due to a dependency conflict with aws-cdk-lib.

Expected Behavior

npm install @aws-cdk/aws-lambda-python-alpha installs the npm package without error

Current Behavior

npm install fails with the following error:

$ npm install -D @aws-cdk/aws-lambda-python-alpha
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/aws-cdk-lib
npm ERR!   aws-cdk-lib@"2.83.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer aws-cdk-lib@"2.84.0" from @aws-cdk/[email protected]
npm ERR! node_modules/@aws-cdk/aws-lambda-python-alpha
npm ERR!   dev @aws-cdk/aws-lambda-python-alpha@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/wongada/.npm/_logs/2023-06-16T03_36_37_821Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wongada/.npm/_logs/2023-06-16T03_36_37_821Z-debug-0.log

Reproduction Steps

  1. Create a new cdk package in TypeScript cdk init app --language=typescript
  2. Try to install @aws-cdk/aws-lambda-python-alpha npm install -D @aws-cdk/aws-lambda-python-alpha
  3. Observe failure above

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.84.0 (build f7c792f)

Framework Version

No response

Node.js Version

v18.16.0

OS

macOS 12.6.5

Language

Typescript

Language Version

No response

Other information

No response

@wong-a wong-a added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 16, 2023
@pahud
Copy link
Contributor

pahud commented Jun 16, 2023

It works for me.

% npm install -D @aws-cdk/aws-lambda-python-alpha

added 1 package, and audited 345 packages in 2s

33 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Can you try again in a clean directory?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 16, 2023
@wong-a
Copy link
Contributor Author

wong-a commented Jun 16, 2023

It also works for me from a new CDK app... I did the same steps yesterday, but I upgraded aws-cdk from 2.83.1 to 2.84.0 in between. So this is not an issue in the current version of aws-cdk.

$ mkdir 26003-repro-2
$ cd 26003-repro-2/
$ cdk init app --language=typescript
Applying project template app for typescript
# Welcome to your CDK TypeScript project

This is a blank project for CDK development with TypeScript.

The `cdk.json` file tells the CDK Toolkit how to execute your app.

## Useful commands

* `npm run build`   compile typescript to js
* `npm run watch`   watch for changes and compile
* `npm run test`    perform the jest unit tests
* `cdk deploy`      deploy this stack to your default AWS account/region
* `cdk diff`        compare deployed stack with current state
* `cdk synth`       emits the synthesized CloudFormation template

Initializing a new git repository...
Executing npm install...
✅ All done!


$ npm install -D @aws-cdk/aws-lambda-python-alpha

added 1 package, and audited 345 packages in 678ms

33 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

@peterwoodworth
Copy link
Contributor

peterwoodworth commented Jun 16, 2023

This occurred for you before because you were trying to install the 2.84.0 version of this package in an app that had conflicting dependencies (i.e. was running another CDK version). This is just npm protecting you, not anything to do with CDK. You can specify the version of the package you download - any CDK packages installed should be the same as the rest of your project:

npm install @aws-cdk/[email protected]

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-python bug This issue is a bug. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants