typeorm / typeorm

ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
http://typeorm.io
MIT License
33.46k stars 6.21k forks source link

The new typeorm version is not compatible with the mongodb driver package version 6.x.x #10842

Open cannaAriel opened 3 weeks ago

cannaAriel commented 3 weeks ago

Issue description

The last version of typeorm (0.3.20) uses mongodb@6.x.x in its devDependencies, but mongodb@5.x.x in its peerDependencies, which causes a dependency conflict with mongodb@6.x.x

Expected Behavior

The version of typeorm's mongodb should be compatible with mongodb@6.x.x

Actual Behavior

I get the following error when I try to run npm i:

npm ERR! Could not resolve dependency:
npm ERR! peerOptional mongodb@"^5.8.0" from typeorm@0.3.20
npm ERR! node_modules/typeorm
npm ERR!   typeorm@"^0.3.20" from the root project
npm ERR!   peer typeorm@"^0.3.0" from @nestjs/typeorm@10.0.2
npm ERR!   node_modules/@nestjs/typeorm
npm ERR!     @nestjs/typeorm@"^10.0.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: mongodb@5.9.2
npm ERR! node_modules/mongodb
npm ERR!   peerOptional mongodb@"^5.8.0" from typeorm@0.3.20
npm ERR!   node_modules/typeorm
npm ERR!     typeorm@"^0.3.20" from the root project
npm ERR!     peer typeorm@"^0.3.0" from @nestjs/typeorm@10.0.2
npm ERR!     node_modules/@nestjs/typeorm
npm ERR!       @nestjs/typeorm@"^10.0.1" 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.

(I can't use --force in certain circumstances)

Steps to reproduce

My Environment

Dependency Version
Operating System macOS
Node.js version 20.12.2
Typescript version 5.4.3
TypeORM version 0.3.20
MongoDB version 6.5.0
NestJS version 10.0.0
nestjs/typeorm version 10.0.1

Additional Context

No response

Relevant Database Driver(s)

Are you willing to resolve this issue by submitting a Pull Request?

No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

texhnolyzer89 commented 2 weeks ago

Got this problem too.

noam-moshe commented 2 weeks ago

Happens to me too.

avitalBruce commented 2 weeks ago

I have the same problem too!🙏🏼