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)
- DynamoDB is missing the key id in the item
- AWS DynamoDB Provisioning Error
- dynamodb cannot create preexisting table
- dynamodb 1 validation error detected value
- an expression attribute name used in the document path is not defined
- error retrieving dynamodb table item serializationexception
- dynamodb condition does not exist
- Float types are not supported. Use decimal types instead.
- a socket operation was attempted to an unreachable network dynamodb
- dynamodb validation error detected
- DynamoDB FilterExpression Not Working
- dynamodb unable to find storage information for property
- validationsettings are not supported for 'dynamodb' endpoint
- dynamodb local unable to locate credentials
- DynamoDB ConditionalCheckFailedException
Tired of AWS Console? Try Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase