Skip to content

Intermittent ETARGET Errors When Resolving Dependencies for @aws-sdk Packages #7054

@ryanwarsaw

Description

@ryanwarsaw

Checkboxes for prior research

Describe the bug

I’ve encountered intermittent ETARGET errors when resolving dependencies for @aws-sdk packages. It appears to be caused by a mismatch in package publishing and dependency resolution. Specifically, AWS SDK packages reference other workspace packages using *, which appears to take the latest version. In some cases, this results in dependencies referencing versions that haven’t yet been published to npmjs.com.

Here’s an example of the issue:

➜ npm ls @aws-sdk/credential-provider-ini
<redacted>
└─┬ @aws-sdk/[email protected]
  └─┬ @aws-sdk/[email protected]
    └── @aws-sdk/[email protected]
@aws-sdk/client-secrets-manager published 4 hours ago
@aws-sdk/credential-provider-node published 3 hours ago
@aws-sdk/credential-provider-ini published 3 hours ago

From the above, @aws-sdk/client-secrets-manager is published earlier and references exact versions of @aws-sdk/credential-provider-node and @aws-sdk/credential-provider-ini that haven’t been published yet. This creates a window of time where dependency resolution breaks.

Relevant package.json files:

Regression Issue

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

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

18.20.8

Reproduction Steps

I'm not sure what causes the delay for some packages when publishing. But that delay is when this issue would present itself.

Observed Behavior

npm error code ETARGET
npm error notarget No matching version found for @aws-sdk/[email protected].
npm error notarget In most cases you or one of your dependencies are requesting
npm error a package version that doesn't exist.

Expected Behavior

Dependency resolution to complete successfully.

Possible Solution

Sequence package publishing so that dependencies are published before the packages that consume them.

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp3This is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions