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 scan missing values
- dynamodb localhost not working
- does not support attribute type arn aws dynamodb
- a bytes-like object is required not binary dynamodb
- dynamodb consistent reads are not supported on global secondary indexes
- dynamodb could not load credentials from any providers
- dynamodb exclusivestartkey not working
- dynamodb table not exists
- validationsettings are not supported for 'dynamodb' endpoint
- dynamodb local unable to locate credentials
- KMS Key Access Denied Error DynamoDB
- DynamoDB Network Error: self signed certificate in chain
- CORS Error DynamoDB
- dynamodb does not accept empty set
- error updating dynamodb table time to live