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

Bug: Cannot find module 'aws-sdk/clients/dynamodb' in Node.js 18.x with javascript v3 #6276

Closed
Sky-Soo-Ap opened this issue Nov 16, 2023 · 3 comments

Comments

@Sky-Soo-Ap
Copy link

Description:

  1. Cannot find module 'aws-sdk/clients/dynamodb in Node.js 18.x with javascript v3:
    Just npm install and usage below modules;
    import { DeleteItemCommand, UpdateItemCommand, GetItemCommand, DynamoDBClient } from "@aws-sdk/client-dynamodb";
    import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
    import { IoTDataPlaneClient, PublishCommand } from "@aws-sdk/client-iot-data-plane"; // ES Modules import

PS: Copy and paste codes to Lambda function is okay which created directly via AWS website.

  1. No need to install AWS SDK javascript v3 as create Lambda function at AWS website;

Steps to reproduce:

Just npm install and usage above modules;
sam deploy --guided;
API Gateway to trigger Lambda function got this error => Cannot find module 'aws-sdk/clients/dynamodb'.

Observed result:

API Gateway to trigger Lambda function got this error => Cannot find module 'aws-sdk/clients/dynamodb'.

Expected result:

  1. Fix this bug => Cannot find module 'aws-sdk/clients/dynamodb in Node.js 18.x with javascript v3:
  2. No need to install AWS SDK javascript v3 as create Lambda function at AWS website;

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Windows 10
  2. sam --version: SAM CLI, version 1.101.0
  3. AWS region: ap-northeast-1
# Paste the output of `sam --info` here

{
"version": "1.101.0",
"system": {
"python": "3.11.4",
"os": "Windows-10-10.0.19045-SP0"
},
"additional_dependencies": {
"docker_engine": "20.10.17",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
Add --debug flag to command you are running

@Sky-Soo-Ap Sky-Soo-Ap added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Nov 16, 2023
@hnnasit
Copy link
Contributor

hnnasit commented Nov 18, 2023

Hi there, it seems you are trying to build a TypeScript application and test the code on AWS console. You can run sam build to transpile code from TypeScript to JavaScript and sam deploy to deploy the stack. More information and examples can be found in 1 and 2. Let us know if you still have further questions or issues.

@hnnasit hnnasit added type/question area/build sam build command area/esbuild and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Nov 18, 2023
@Sky-Soo-Ap
Copy link
Author

No changed and can not reproducible, so closed it.

Copy link
Contributor

⚠️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
Projects
None yet
Development

No branches or pull requests

2 participants