Mongodb-memory-server: Failed to download/install MongoDB binaries. The error: Error: Status Code is 403 (MongoDB's 404)

Created on 9 Jun 2020  路  6Comments  路  Source: nodkz/mongodb-memory-server

Versions

  • NodeJS: 12.18.0
  • mongodb-memory-server-*: 6.6.1
  • system: WSL/2 Debian 10

package: mongo-memory-server

What is the Problem?

Code Example

npm i -D mongodb-memory-server@latest
npm WARN deprecated @types/[email protected]: This is a stub types definition. get-port provides its own type definitions, so you do not need this installed.

> [email protected] postinstall /projects/erp-backend/node_modules/mongodb-memory-server
> node ./postinstall.js

mongodb-memory-server: checking MongoDB binaries cache...
failed to download/install MongoDB binaries. The error: Error: Status Code is 403 (MongoDB's 404)

This means that the requested version-platform combination dosnt exist
+ [email protected]
updated 3 packages and audited 1523 packages in 9.407s

51 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Do you know why it happenes?

no

Is there a workaround to fix that?
Example of running test & debug : 1
image

bug

Most helpful comment

For me, "latest" did not work, the latest current version "4.4.1" worked:

  "config": {
    "mongodbMemoryServer": {
      "version": "4.4.1"
    }
  }

All 6 comments

Adding this to package.json & reinstalling mongodb-memory-server fixes my issue.

"config": {
    "mongodbMemoryServer": {
      "version": "latest"
    }
  },

if I try the above I get this:

failed to download/install MongoDB binaries. The error: TypeError: Invalid Version: latest

@ekelvin please open an new issue, detailing what system you are on

For me, "latest" did not work, the latest current version "4.4.1" worked:

  "config": {
    "mongodbMemoryServer": {
      "version": "4.4.1"
    }
  }

Make sure that the link be created by MongoDownloadURL has the correct arch set up.

in my case it was trying to download the 1386 arch when I was actually running a x64 arch.
You can change the arch by

"config": { "mongodbMemoryServer": { "debug": "1", "arch": "x64" } },

@tcanbolat if it thinks its i386, then it probably means the 32bit version of nodejs is installed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexandrulesi picture alexandrulesi  路  8Comments

falkenhawk picture falkenhawk  路  4Comments

baptLesta picture baptLesta  路  7Comments

EnergeticPixels picture EnergeticPixels  路  3Comments

elreeda picture elreeda  路  3Comments