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 string set cannot be empty
- dynamodb ttl not deleting / erasing items
- why is the GSI dynamodb not showing item count
- AWS DynamoDB CredentialsError: Missing credentials in config
- failed to begin subsegment named 'amazondynamodbv2': segment cannot be found.
- dynamodb cannot create preexisting table
- DynamoDB Update Not Working
- DynamoDB Is Unsupported It Cannot Be Instantiated
- DynamoDB - The Security Token Included In The Request Is Invalid
- Unable to start DynamoDB Local process
- One or more parameter values were invalid: some AttributeDefinitions are not used
- dynamodb cannot assign requested address
- DynamoDB Error All Attributes Must Be Indexed
- dynamodb-admin command not found
- DynamoDB Local Docker Not Working
Tired of AWS Console? Try Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2026 Dynobase