Skip to content

Specifying a version to install requires newer dependencies than specified, which breaks on older systems #7057

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

Open
3 of 4 tasks
nabeards opened this issue May 6, 2025 · 6 comments
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue

Comments

@nabeards
Copy link

nabeards commented May 6, 2025

Checkboxes for prior research

Describe the bug

I have a legacy project that requires node version 14. I know this version is no longer officially supported, but this is actually an issue with just installation, not use. Installing the last version of the SDK that supports nodejs version 14 doesn't work due to dependency issues.

Install and resulting error:
yarn add @aws-sdk/[email protected]
error @aws-sdk/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "14.18.1"

I installed that same version into another project using a later nodejs version, and found that multiple dependencies somehow force-require later versions (3.804). Below is the full module dependency tree. For example, you'll see that later versions of lower dependencies are being required, [email protected], [email protected], [email protected], etc. I would expect installing a specific version would work.

└─┬ @aws-sdk/[email protected]
  └─┬ @aws-sdk/[email protected]
    ├─┬ @aws-sdk/[email protected]
    │ └─┬ @aws-sdk/[email protected]
    │   ├─┬ @aws-crypto/[email protected]
    │   │ ├─┬ @aws-crypto/[email protected]
    │   │ │ └── @aws-sdk/[email protected] deduped
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-crypto/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-sdk/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-sdk/[email protected]
    │   │ ├─┬ @aws-sdk/[email protected]
    │   │ │ └── @aws-sdk/[email protected] deduped
    │   │ ├─┬ @aws-sdk/[email protected]
    │   │ │ └── @aws-sdk/[email protected] deduped
    │   │ ├─┬ @aws-sdk/[email protected]
    │   │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ ├─┬ @aws-crypto/[email protected]
    │   │ │ │ │ ├─┬ @aws-crypto/[email protected]
    │   │ │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├─┬ @aws-crypto/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├── @aws-sdk/[email protected]
    │   │ │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ │ └─┬ @aws-sdk/[email protected]
    │   │ │ │   └── @aws-sdk/[email protected] deduped
    │   │ │ └── @aws-sdk/[email protected] deduped
    │   │ ├─┬ @aws-sdk/[email protected]
    │   │ │ └── @aws-sdk/[email protected] deduped
    │   │ ├─┬ @aws-sdk/[email protected]
    │   │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ ├─┬ @aws-sdk/[email protected]
    │   │ │ │ └── @aws-sdk/[email protected] deduped
    │   │ │ └── @aws-sdk/[email protected] deduped
    │   │ ├─┬ @aws-sdk/[email protected]
    │   │ │ └── @aws-sdk/[email protected] deduped
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-sdk/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-sdk/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-sdk/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-sdk/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-sdk/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├── @aws-sdk/[email protected]
    │   ├─┬ @aws-sdk/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   ├─┬ @aws-sdk/[email protected]
    │   │ └── @aws-sdk/[email protected] deduped
    │   └─┬ @aws-sdk/[email protected]
    │     └── @aws-sdk/[email protected] deduped
    └─┬ @aws-sdk/[email protected]
      └─┬ @aws-sdk/[email protected]
        └─┬ @aws-sdk/[email protected]
          ├─┬ @aws-crypto/[email protected]
          │ ├─┬ @aws-crypto/[email protected]
          │ │ └── @aws-sdk/[email protected] deduped
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-crypto/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-sdk/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-sdk/[email protected]
          │ ├─┬ @aws-sdk/[email protected]
          │ │ └── @aws-sdk/[email protected] deduped
          │ ├─┬ @aws-sdk/[email protected]
          │ │ └── @aws-sdk/[email protected] deduped
          │ ├─┬ @aws-sdk/[email protected]
          │ │ └── @aws-sdk/[email protected] deduped
          │ ├─┬ @aws-sdk/[email protected]
          │ │ └── @aws-sdk/[email protected] deduped
          │ ├─┬ @aws-sdk/[email protected]
          │ │ ├─┬ @aws-sdk/[email protected]
          │ │ │ └── @aws-sdk/[email protected] deduped
          │ │ ├─┬ @aws-sdk/[email protected]
          │ │ │ └── @aws-sdk/[email protected] deduped
          │ │ └── @aws-sdk/[email protected] deduped
          │ ├─┬ @aws-sdk/[email protected]
          │ │ └── @aws-sdk/[email protected] deduped
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-sdk/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-sdk/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-sdk/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-sdk/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-sdk/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          ├── @aws-sdk/[email protected]
          ├─┬ @aws-sdk/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          ├─┬ @aws-sdk/[email protected]
          │ └── @aws-sdk/[email protected] deduped
          └─┬ @aws-sdk/[email protected]
            └── @aws-sdk/[email protected] deduped

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

node v14.18.1

Reproduction Steps

nvm use 14
npm i yarn
yarn add @aws-sdk/[email protected]
error @aws-sdk/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "14.18.1"

Observed Behavior

error @aws-sdk/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "14.18.1"

Expected Behavior

Installing version 3.565 should successfully install with proper dependencies.

Possible Solution

No response

Additional Information/Context

No response

@nabeards nabeards added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 6, 2025
@zshzbh
Copy link
Contributor

zshzbh commented May 6, 2025

Please update your node version as the JS SDK v3 has dropped support for Node.js 14.x on May 1, 2024. PR

@zshzbh zshzbh added closing-soon This issue will automatically close in 4 days unless further comments are made. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels May 6, 2025
@zshzbh zshzbh self-assigned this May 6, 2025
@nabeards
Copy link
Author

nabeards commented May 6, 2025

@zshzbh As already stated: "I have a legacy project that requires node version 14. I know this version is no longer officially supported, but this is actually an issue with just installation, not use. Installing the last version of the SDK that supports nodejs version 14 doesn't work due to dependency issues."

Running the same install with Node 18 still installs the later versions of the packages, so specifying the version number is broken on later versions of node as well. Here's the wrong version install from node 18:

└─┬ @aws-sdk/[email protected]
  ├─┬ @aws-crypto/[email protected]
  │ ├─┬ @aws-crypto/[email protected]
  │ │ └── @aws-sdk/[email protected]
  │ └── @aws-sdk/[email protected]
  ├─┬ @aws-crypto/[email protected]
  │ └── @aws-sdk/[email protected]
  ├─┬ @aws-crypto/[email protected]
  │ └── @aws-sdk/[email protected]
  └─┬ @aws-sdk/[email protected]
    ├─┬ @aws-crypto/[email protected]
    │ └── @aws-sdk/[email protected]
    └─┬ @aws-crypto/[email protected]
      └── @aws-sdk/[email protected]

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 7, 2025
@zshzbh
Copy link
Contributor

zshzbh commented May 7, 2025

I think the one last try would be setting engine-strict=true .


If you insist to use Node 14, I just came up with a solution, it might be weird, but you can upgrade the node version to ">=18.0.0" and install the aws js sdk package, and use node version 14(I don't know if that's gonna work tho, if that's not working, it's not working, and we won't fix this because the support for Node.js 14.x has been dropped).

Still, I highly suggest to upgrade node version as node 14 has reached end of life in Feb 16, 2023 - https://nodejs.org/en/about/previous-releases


For node 18 installations -

Running the same install with Node 18 still installs the later versions of the packages, so specifying the version number is broken on later versions of node as well. Here's the wrong version install from node 18:


└─┬ @aws-sdk/[email protected]
  ├─┬ @aws-crypto/[email protected]
  │ ├─┬ @aws-crypto/[email protected]
  │ │ └── @aws-sdk/[email protected]
  │ └── @aws-sdk/[email protected]
  ├─┬ @aws-crypto/[email protected]
  │ └── @aws-sdk/[email protected]
  ├─┬ @aws-crypto/[email protected]
  │ └── @aws-sdk/[email protected]
  └─┬ @aws-sdk/[email protected]
    ├─┬ @aws-crypto/[email protected]
    │ └── @aws-sdk/[email protected]
    └─┬ @aws-crypto/[email protected]
      └── @aws-sdk/[email protected]

What error message did you see? Could you please post the error message here?

@zshzbh zshzbh added closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels May 7, 2025
@nabeards
Copy link
Author

nabeards commented May 8, 2025

@zshzbh thanks for the response.

engine-strict=true produces a similar error:

% npm i @aws-sdk/[email protected]      
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for @aws-sdk/[email protected]: wanted: {"node":">=18.0.0"} (current: {"node":"14.18.1","npm":"6.14.15"})
npm ERR! notsup Not compatible with your version of node/npm: @aws-sdk/[email protected]
npm ERR! notsup Not compatible with your version of node/npm: @aws-sdk/[email protected]
npm ERR! notsup Required: {"node":">=18.0.0"}
npm ERR! notsup Actual:   {"npm":"6.14.15","node":"14.18.1"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nabeards/.npm/_logs/2025-05-08T08_59_58_233Z-debug.log

Regarding upgrading: Legacy projects can't just be upgraded to the latest version of node for convenience sake. It would be a major undertaking to rewrite the software to work with a newer version.


Regarding the Node 18 installation: there isn't an error per se, but you can see that it is still installing the latest versions of the tooling even when requesting a specific version of the software. If I request installation of version 3.565, I expect all of the dependencies to match that version. Instead, [email protected] is still installed. This is the crux of the issue: if I want a specific version of the tooling, I should only get that version and not the latest dependencies.


The good news is that I think I found a solution. I had to manually install two packages with specific versions in order to get client-s3 to install, and I could not use yarn (so this is not a great solution since I'll have to do a lot of magic to get this to auto-install). But here's what I did nonetheless:

npm i @aws-sdk/[email protected]
npm i @aws-sdk/[email protected]
npm i @aws-sdk/[email protected]

As I said, the main issue is that requesting a specific version of client-s3 just doesn't work with dependencies. I would expect installing [email protected] would install only the matching dependencies of 3.565 (in other words, installed [email protected] and [email protected] for me). It currently just installs the latest dependencies instead, breaking everything.

Another solution would be that the package here was using proper semver instead, but I don't see that happening. (Completely removing support for a specific node version should have moved the major release version number up from 3 to 4.)

@kuhe
Copy link
Contributor

kuhe commented May 8, 2025

Edit: I posted this without the latest comment from @nabeards having loaded, a workaround was found.


This is because the @aws-crypto/* packages use a range of @aws-sdk/types.

Please work around this by adding an override for the @aws-sdk/types package used by the crypto packages. Either include @aws-sdk/types@<=3.565.0 in dependencies, or set

  "overrides": {
    "@aws-sdk/types": "<=3.565.0"
  },
  "resolutions": {
    "@aws-sdk/types": "<=3.565.0"
  },

@nabeards
Copy link
Author

nabeards commented May 8, 2025

@kuhe your overrides workaround only works in NPM versions greater than 8.3.0, which I think I could custom-install for NodeJS v14. I did try with the @aws-sdk/types@<=3.565.0, but it still didn't work for me on NodeJS v14 with npm v6 (attempts were still made when trying to install client-s3 to install [email protected]). I appreciate the suggestion though, and using npm 8.3 with the overrides may be a solution for auto-installing in the future.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

3 participants