anacronw / multer-s3

multer storage engine for amazon s3
MIT License
662 stars 193 forks source link

Unmet dependencys - multer-s3 ^3.0.0 #175

Closed JotaOdiceu closed 2 years ago

JotaOdiceu commented 2 years ago

When I run "yarn install multer-s3", the following warnins are shown:

warning "> multer-s3@3.0.1" has unmet peer dependency "@aws-sdk/client-s3@^3.0.0".
warning "multer-s3 > @aws-sdk/lib-storage@3.100.0" has unmet peer dependency "@aws-sdk/abort-controller@^3.0.0".
warning "multer-s3 > @aws-sdk/lib-storage@3.100.0" has unmet peer dependency "@aws-sdk/client-s3@^3.0.0".

This has been happening since version 3.0.0, in previous versions this did not happen, to correct I am performing a workaround installing the unmet dependencies individually.

Takaitra commented 2 years ago

I took a look and these are both valid peer dependencies.

  1. Both lib-storage and multer-s3 are compatible with @aws-sdk/client-s3@^3.0.0. The consumer should declare an explicit dependency on the version of client-s3 they prefer.
  2. @aws-sdk/abort-controller is an optional peer dependency of lib-storage. The consumer should explicity declare a dependency on abort-controller if they need it.

These peer dependencies are working as intended so installing them individually is the proper fix for the warning, not a workaround.

JotaOdiceu commented 2 years ago

I understand, in versions prior to 3.0.0 of multer-s3, these dependencies were not "necessary" and multer-s3 worked well alongside the aws-sdk package. As I understand it, now in this update it is necessary to install these additional dependencies, that is?

LinusU commented 2 years ago

@JotaOdiceu as you can see here in the readme, version 3.x of multer-s3 works with the new @aws-sdk/client-s3 package, whilst version 2.x of multer-s3 works with the old aws-sdk package. When you upgrade to 3.x you must also upgrade to the new AWS SDK at the same time...