mongodb-memory-server: [Windows] Error: Status Code is 403 (MongoDB's 404)

Versions

  • NodeJS: 0.0.0
  • mongodb-memory-server-*: 6.6.6
  • mongodb: 0.0.0
  • mongoose: 5.10.1
  • system: Windows

package: mongo-memory-server

What is the Problem?

Can’t start mongodb-memory-server for the tests

Code Example

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

Do you know why it happenes?

no

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 26

Most upvoted comments

For fellow Windows user that looking for a copy paste solution, running the following commands will fix this error in your local.

set MONGOMS_DOWNLOAD_URL=https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.14.zip
npm i -D mongodb-memory-server

For me this is good enough because our CI runs in Unix which don’t hit this error.

@austi10 i think increasing the “latest version” variable in the code will fix this, but that is one major patch, and i think this might take a while

in the mean time, you can overwrite the download url, with MONGOMS_DOWNLOAD_URL / (package.json)downloadUrl (needs to contain the full link, example: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz)

PS: this problem only exists because mongodb dosnt name their files in a consistent manner

@austi10 when you are on windows, you can look at the link below what versions are available: https://dl.mongodb.org/dl/win32