typegoose / mongodb-memory-server

Manage & spin up mongodb server binaries with zero(or slight) configuration for tests.
https://typegoose.github.io/mongodb-memory-server/
MIT License
2.56k stars 185 forks source link

Requested Version "6.0.14" is not available for "Debian 12"! Available Versions: ">=7.0.3" #870

Closed k-gupta-2001 closed 4 months ago

k-gupta-2001 commented 4 months ago

Versions

package: mongo-memory-server

What is your question?

When running my test cases , this is the error i am getting

Requested Version "6.0.14" is not available for "Debian 12"! Available Versions: ">=7.0.3" Mongodb does not provide binaries for versions before 7.0.3 for Debian 12+ and also cannot be mapped to a previous Debian release

  14 |
  15 | async function start_database() {
> 16 |     mongoServer = await MongoMemoryServer.create()
     |                   ^
  17 |     mongoUri = mongoServer.getUri()
  18 |     try {
  19 |         db = await mongoose.connect(mongoUri, {

  at MongoBinaryDownloadUrl.getDebianVersionString (node_modules/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts:313:15)
  at start_database (__test__/integration/database/db.js:16:19)
  at Object.<anonymous> (__test__/setup.js:10:9)

Can you please provide steps to resolve this , i am stuck and not able to understand what to do

hasezoey commented 4 months ago

as the error says you will need to manually set a mongodb version to be used, the default for MMS 9.x is mongodb 6.0.x, see Mongodb Server Versions on what the policy for mongodb versions is and what versions use what default version.

TL;DR: set MONGOMS_VERSION=7.0.3 (or higher) as a environment variable or as a package.json config option