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

typeorm Not Compatible with Latest Version of Mongo #10880

Open marc-wilson opened 1 week ago

marc-wilson commented 1 week ago

Issue description

Mongo dependency bug

Expected Behavior

I would be able to use the latest supported version of the the mongo npm package.

Actual Behavior

You can only have mongodb 5.8 installed.

Steps to reproduce

My Environment

Dependency Version
Operating System
Node.js version x.y.zzz
Typescript version x.y.zzz
TypeORM version x.y.zzz

Additional Context

I have a project where I am experimenting with typeorm. I am using it in a monorepo and right now it's scoped to SQL only. I am trying to update mongodb to the latest version (6.6.0) but I am receiving an error because typeorm wants it to be 5.8.

Looking at the package.json, it looks like mongodb 6.3.0 is registered as a dev dependency and mongo 5.8 is a peer dependency. I'm assuming the peer dependency of 5.8 in typeorm is what is preventing me from updating my unrelated project to the lastest package.

npm ERR! While resolving: typeorm@0.3.20 npm ERR! Found: mongodb@6.6.0 npm ERR! node_modules/mongodb npm ERR! mongodb@"^6.6.0" from the root project npm ERR! 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.2" 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.2" from the root project

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.

Rochet2 commented 1 week ago

Looks like there is a related PR here: https://github.com/typeorm/typeorm/pull/10746