Error: aws.dynamodb.documentclient is not a constructor

Answered by Rafal Wilinski
What's Causing This Error
This error occurs in Node.js when you install an older version of the AWS SDK. AWS introduced the DocumentClient in version 2.2.0 of the AWS SDK. So all applications running a version number lower than 2.2.0 of the AWS SDK will experience this error as the DocumentClient does not exist in these earlier versions.
Solution - Here's How To Resolve It
To resolve the error, install the latest version of the AWS SDK using the below command.
npm i aws-sdk@latest
If the above command does not work, delete the package-lock.json
file and re-rerun the command.
Other Common DynamoDB Errors (with Solutions)
- boto3 dynamodb client error
- comparison operator does not return all attributes dynamodb
- sls dynamodb install not working
- dynamodb item size limit error
- DynamoDB error cannot find module build/Release/DTraceProviderBindings
- dynamodb unknown error
- dynamodb throttle error code
- ProvisionedThroughputExceededException DynamoDB
- DynamoDB delete fails
- DynamoDB local is not available for stage test
- appsync dynamodb not seeing all fields
- DynamoDB scan filter not working
- DynamoDB local error unable to access JAR file dynamodblocal.jar
- DynamoDB table not updating
- DynamoDB Invalid UpdateExpression Syntax Error Token
Better DynamoDB experience.
First 7 days are. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase