cdklabs / cdk-monitoring-constructs

Easy-to-use CDK constructs for monitoring your AWS infrastructure
https://constructs.dev/packages/cdk-monitoring-constructs
Apache License 2.0
444 stars 56 forks source link

upgrade @aws-cdk/aws-synthetics-alpha peer dependency to latest. #400

Closed imaitland closed 11 months ago

imaitland commented 11 months ago

Getting following error:

Running build command 'run-npm'
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: cdk-monitoring-constructs@5.3.5
npm ERR! Found: @aws-cdk/aws-synthetics-alpha@2.88.0-alpha.0
npm ERR! node_modules/@aws-cdk/aws-synthetics-alpha
npm ERR!   dev @aws-cdk/aws-synthetics-alpha@"^2.88.0-alpha.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @aws-cdk/aws-synthetics-alpha@"^2.65.0-alpha.0" from cdk-monitoring-constructs@5.3.5
npm ERR! node_modules/cdk-monitoring-constructs
npm ERR!   peer cdk-monitoring-constructs@"^5.0.0" from <package>@15.0.0
npm ERR!   node_modules/<package>
npm ERR!     dev <package>@"^15.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @aws-cdk/aws-synthetics-alpha@2.65.0-alpha.0
npm ERR! node_modules/@aws-cdk/aws-synthetics-alpha
npm ERR!   peer @aws-cdk/aws-synthetics-alpha@"^2.65.0-alpha.0" from cdk-monitoring-constructs@5.3.5
npm ERR!   node_modules/cdk-monitoring-constructs
npm ERR!     peer cdk-monitoring-constructs@"^5.0.0" from <package>@15.0.0
npm ERR!     node_modules/<package>
npm ERR!       dev <package>@"^15.0.0" 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/iainland/.npm/_logs/2023-07-28T20_29_24_009Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/iainland/.npm/_logs/2023-07-28T20_29_24_009Z-debug-0.log
'npm install' exited 1

I don't want to downgrade to 2.65, as it does not support newer puppeteer runtimes.

e.g. with 2.65 i cannot use: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0

echeung-amzn commented 11 months ago

There's no reason to bump up the dependencies unless we need something from a newer version. The alpha modules' versioning is awkward such that semver ranges don't quite work the way you expect.

If you want to use a newer version that you have a concrete dependency on, use overrides in your package.json file:

"dependencies": {
  "@aws-cdk/aws-synthetics-alpha": "2.88.0-alpha.0",
  "cdk-monitoring-constructs": "5.3.5",
  ...
},
"overrides": {
  "cdk-monitoring-constructs": {
    "@aws-cdk/aws-synthetics-alpha": "$@aws-cdk/aws-synthetics-alpha"
  }
}
imaitland commented 11 months ago

Thanks!