Cannot find module `'@aws-sdk/credential-provider-process'` for S3 and SNS clients.
See original GitHub issueCheckboxes for prior research
- I’ve gone through Developer Guide and API reference
- I’ve checked AWS Forums and StackOverflow.
- I’ve searched for previous similar issues and didn’t find any solution.
Describe the bug
I try to upgrade @aws-sdk packages from 3.188.0 to 3.226.0 and as up to 3.224.0 I encountered issue from https://github.com/aws/aws-sdk-js-v3/issues/4075, running clients from 3.226.0 causes that a different message is emitted:
Error: Cannot find module '@aws-sdk/credential-provider-process'
Require stack:
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.226.0/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProcessCredentials.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.226.0/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProfileData.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.226.0/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/fromIni.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.226.0/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-node@3.226.0/node_modules/@aws-sdk/credential-provider-node/dist-cjs/defaultProvider.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-node@3.226.0/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js
- /project/node_modules/.pnpm/@aws-sdk+client-sts@3.226.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js
- /project/node_modules/.pnpm/@aws-sdk+client-sts@3.226.0/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js
- /project/node_modules/.pnpm/@aws-sdk+client-sts@3.226.0/node_modules/@aws-sdk/client-sts/dist-cjs/STS.js
- /project/node_modules/.pnpm/@aws-sdk+client-sts@3.226.0/node_modules/@aws-sdk/client-sts/dist-cjs/index.js
- /project/node_modules/.pnpm/@aws-sdk+client-s3@3.226.0/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js
- /project/node_modules/.pnpm/@aws-sdk+client-s3@3.226.0/node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js
- /project/node_modules/.pnpm/@aws-sdk+client-s3@3.226.0/node_modules/@aws-sdk/client-s3/dist-cjs/S3.js
- /project/node_modules/.pnpm/@aws-sdk+client-s3@3.226.0/node_modules/@aws-sdk/client-s3/dist-cjs/index.js
I’ve tried to install @aws-sdk/credential-providers but it did not resolve the issue. The issue can be resolved by installing @aws-sdk/credential-provider-process but the docs says clearly:
## Usage
You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers) instead.
So I believe it is not an intentional flow.
SDK version number
@aws-sdk/package-name@version, …
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
16.13.1 but the same happens on Node 18
Reproduction Steps
Just initialize a SQS client
const { SQS } = require( '@aws-sdk/client-sqs' );
this._sqs = new SQS( config );
Observed Behavior
Error: Cannot find module '@aws-sdk/credential-provider-process'
Require stack:
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.226.0/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProcessCredentials.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.226.0/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProfileData.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.226.0/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/fromIni.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.226.0/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-node@3.226.0/node_modules/@aws-sdk/credential-provider-node/dist-cjs/defaultProvider.js
- /project/node_modules/.pnpm/@aws-sdk+credential-provider-node@3.226.0/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js
- /project/node_modules/.pnpm/@aws-sdk+client-sts@3.226.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js
- /project/node_modules/.pnpm/@aws-sdk+client-sts@3.226.0/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js
- /project/node_modules/.pnpm/@aws-sdk+client-sts@3.226.0/node_modules/@aws-sdk/client-sts/dist-cjs/STS.js
- /project/node_modules/.pnpm/@aws-sdk+client-sts@3.226.0/node_modules/@aws-sdk/client-sts/dist-cjs/index.js
- /project/node_modules/.pnpm/@aws-sdk+client-s3@3.226.0/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js
- /project/node_modules/.pnpm/@aws-sdk+client-s3@3.226.0/node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js
- /project/node_modules/.pnpm/@aws-sdk+client-s3@3.226.0/node_modules/@aws-sdk/client-s3/dist-cjs/S3.js
- /project/node_modules/.pnpm/@aws-sdk+client-s3@3.226.0/node_modules/@aws-sdk/client-s3/dist-cjs/index.js
Expected Behavior
As before 3.188.0 it was possible to use clients without additional credential packages I believe that including required libs is expected. If the lib cannot be included in the client packages, then adding @aws-sdk/credential-providers should resolve the issue.
Possible Solution
No response
Additional Information/Context
No response
Issue Analytics
- State:
- Created 9 months ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Related StackOverflow Question
Hello, I have similar issue with 3 different AWS SDK libs. I’m using PNPM with no hoisting. Some of dependencies are set as dev dependencies even if they used in the code.
@mhassan1 I can confirm https://github.com/aws/aws-sdk-js-v3/pull/4302 resolved the issue, thank you for your help! I close the issue as completed. Also @RanVaknin thanks for your involvement.