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.58k stars 187 forks source link

MongoDB Memory Server - 403 error (MongoDB's 404) #481

Closed LuisBarroso37 closed 3 years ago

LuisBarroso37 commented 3 years ago

Versions

package: mongo-memory-server

What is the Problem?

I have been using mongodb-memory-server for quite some time and never had any real issues. Today, all of a sudden, it stopped working and now I can't run any tests. Every time I run npm run test I get a 403 Error saying that the requested version-platform combination doesn't exist. It says I have arch: 'ia32' and platform: 'windows'.

I have searched online and tried some solutions like:

or

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

Can you help me debug this?

## Code Example

Error: Status Code is 403 (MongoDB's 404) This means that the requested version-platform combination doesn't exist Used Url: "https://fastdl.mongodb.org/win32/mongodb-win32-i386-2008plus-ssl-4.0.14.zip" Try to use different version 'new MongoMemoryServer({ binary: { version: 'X.Y.Z' } })' List of available versions can be found here: https://www.mongodb.org/dl/linux for Linux https://www.mongodb.org/dl/osx for OSX https://www.mongodb.org/dl/win32 for Windows

  at ClientRequest.<anonymous> (node_modules/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts:341:17)
Package.json:

{ "name": "rootit-roa-server", "version": "1.0.1", "private": true, "scripts": { "start:dev": "set REACT_SERVER_STAGE=local&& ts-node-dev --poll src/index.ts", "start": "node build/index.js", "build": "tsc -p .", "test": "jest --runInBand --watchAll --no-cache" }, "jest": { "preset": "ts-jest", "testEnvironment": "node", "setupFilesAfterEnv": [ "./src/test/setup.ts" ] }, "dependencies": { "@azure/cosmos": "^3.10.3", "@azure/storage-blob": "^12.5.0", "axios": "^0.21.1", "cookie-parser": "^1.4.4", "cors": "^2.8.5", "dotenv": "^8.2.0", "express": "^4.16.1", "express-async-errors": "^3.1.1", "express-fileupload": "^1.2.1", "express-validator": "^6.10.0", "helmet": "^4.4.1", "jsonwebtoken": "^8.5.1", "mongoose": "^5.12.2", "morgan": "^1.9.1", "socket.io": "^4.0.1" }, "devDependencies": { "@types/cookie-parser": "^1.4.2", "@types/cors": "^2.8.10", "@types/debug": "^4.1.5", "@types/express": "^4.17.11", "@types/express-fileupload": "^1.1.6", "@types/jest": "^26.0.22", "@types/jsonwebtoken": "^8.5.1", "@types/morgan": "^1.9.2", "@types/supertest": "^2.0.10", "@typescript-eslint/eslint-plugin": "^4.19.0", "@typescript-eslint/parser": "^4.19.0", "eslint": "^7.23.0", "eslint-config-airbnb-typescript": "^12.3.1", "eslint-config-prettier": "^8.1.0", "eslint-plugin-jest": "^24.3.2", "eslint-plugin-prettier": "^3.3.1", "jest": "^26.6.3", "jest-junit": "^12.1.0", "jest-websocket-mock": "^2.2.0", "mock-socket": "^9.0.3", "mongodb-memory-server": "^6.9.6", "prettier": "^2.2.1", "supertest": "^6.1.3", "ts-jest": "^26.5.4", "ts-node-dev": "^1.1.6", "typescript": "^4.2.3" } }

hasezoey commented 3 years ago

This seems to be an Duplicate of #479

LuisBarroso37 commented 3 years ago

Hey @hasezoey, I tried the same solution in issue #479 that you mentioned and it worked. I had to uninstall node.js and install it again and make sure to choose the download for windows x64.

Thank you for your help!

hasezoey commented 3 years ago

Duplicate of #479

this is just to mark it as an actual duplicate