sqs-consumer
sqs-consumer copied to clipboard
Aws-Sdk dependency error
Question I am currently using version "5.5.0", when I checked required dependencies and "aws-sdk" is devDependency. Here is my question. When I use this library without installing aws-sdk the following error occurs.
`Cannot find module 'aws-sdk/clients/sqs' from 'node_modules/sqs-consumer/dist/consumer.js'
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
at Object.<anonymous> (node_modules/sqs-consumer/dist/consumer.js:4:13)`
Could you please add aws-sdk as a dependency?
Additional context
Also I need to install whole aws-sdk package. For example I only want to install sqs package of aws-sdk as @aws-sdk/client-sqs but this throws same error
There really is no need to make the AWS-SDK a dependency when it can be installed with one command. As for the not including the entire SDK, you will need to include the entire SDK.
This bit us yesterday. We removed the aws-sdk as a dependency from our application. When developing locally dev deps were installed and everything was working fine - on deploy to our stage environment the app suddenly crashes because sqs-consumer is missing aws-sdk. Sure, it was easy to install aws-sdk back again, but this is not what we expected.
Sounds like it needs to be a peer dependency (sorry for the late reply, we're working on it ;) ).
In the latest update, aws-sdk was moved to a dependency, it is believed that it was always meant to be here, it just wasn't for some reason as sqs-producer has aws-sdk in it's dependencies list already.
We do also require the dependency in the source code.
This will be in the package when we release 5.4.0 :)