mapper icon indicating copy to clipboard operation
mapper copied to clipboard

Dependency conflict with reflect-metadata when install with NestJS

Open Skryabind opened this issue 1 year ago • 8 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the issue

I have installed NestJs and have reflect-metadata in my dependencies: "reflect-metadata": "^0.2.0"

I try to install automapper libs: npm i --save @automapper/core @automapper/nestjs @automapper/classes reflect-metadata and get a error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/reflect-metadata
npm ERR!   reflect-metadata@"^0.2.0" from [email protected]
npm ERR!   api
npm ERR!     [email protected]
npm ERR!     node_modules/api
npm ERR!       workspace api from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer reflect-metadata@"~0.1.13" from @automapper/[email protected]
npm ERR! node_modules/@automapper/classes
npm ERR!   @automapper/classes@"*" from [email protected]
npm ERR!   api
npm ERR!     [email protected]
npm ERR!     node_modules/api
npm ERR!       workspace api from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 

I found that @automapper/classes has fixed version of reflect-metadata 0.1.13 ans it's conflicted with new versions like 0.2.0. Can automapper/classes be updated to the latest version of reflect-metadata, or maybe there is some other way to fix a problem?

Models/DTOs/VMs

No response

Mapping configuration

No response

Steps to reproduce

  1. Add "reflect-metadata": "^0.2.0" in your project dependencies.
  2. Install automapper libs: npm i --save @automapper/core @automapper/nestjs @automapper/classes

Expected behavior

Expect to automapper can be installed with the latest reflect-metadata lib

Screenshots

No response

Minimum reproduction code

No response

Package

  • [ ] I don't know.
  • [ ] @automapper/core
  • [X] @automapper/classes
  • [ ] @automapper/nestjs
  • [ ] @automapper/pojos
  • [ ] @automapper/mikro
  • [ ] @automapper/sequelize
  • [ ] Other (see below)

Other package and its version

No response

AutoMapper version

8.0.0

Additional context

Linux node v16.20.1

Skryabind avatar Mar 17 '24 19:03 Skryabind

Same bug here...

TeoConan avatar Apr 17 '24 11:04 TeoConan

Any idea when approval on the PR will come in?

KroniKZA avatar Apr 29 '24 11:04 KroniKZA

in the meantime you can use npm install --legacy-peer-deps (but I agree it is not clean)

irazers avatar May 19 '24 06:05 irazers

same issue

swang2019 avatar Jul 21 '24 13:07 swang2019