relay-workshop icon indicating copy to clipboard operation
relay-workshop copied to clipboard

MongoError: Mongodb does not provide binaries for versions before 4.2.1

Open italosantana opened this issue 2 years ago • 2 comments

Open this issue, in case, you had this error when to run testing in this project.


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

In my case, I'm using debian 11 version. Sure, error tell me what to do...

<rootDir>/apps/server/test/environment/mongodb.js.

Check this in mondodb.js

const dbName = config.MONGO_URI_TEST.split('/')[3];

 // TODO - enable replset if needed
 // this.mongod = new MongoMemoryReplSet({
 this.mongod = new MongoMemoryServer({
   instance: {
     // settings here
     // dbName is null, so it's random
     dbName,
   },
   binary: {
  -------------->   version: '4.0.5',
   },
   // debug: true,
   autoStart: false,
 });
}

Change the version the error is inducing to which will work on your OS. In my case, using 4.2.1 running as well...

italosantana avatar May 20 '22 13:05 italosantana

make this a .env ?

sibelius avatar May 20 '22 13:05 sibelius

it is not necessary. this is a common compatibility error in mongo memory server, it only reports that it must change the binary version, where I put the arrow in the mongodb.js file. When you do that, you will see that the error will change and it will start to download the instance on your machine.

italosantana avatar May 20 '22 14:05 italosantana