typegoose/mongodb-memory-server

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

ecalcutin opened this issue ยท 6 comments

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/get-port@4.2.0: This is a stub types definition. get-port provides its own type definitions, so you do not need this installed.

> mongodb-memory-server@6.6.1 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
+ mongodb-memory-server@6.6.1
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

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