Skip to content
\n

Which give the following result

\n
$ npm install\nnpm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\nnpm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.\nadded 647 packages, and audited 648 packages in 21s\n44 packages are looking for funding\n  run `npm fund` for details\nfound 0 vulnerabilities\n$ uname -a\nLinux runner-ndqklj7-project-62502-concurrent-0dwq58 5.10.43-flatcar #1 SMP Tue Jun 15 19:46:57 -00 2021 x86_64 Linux\n$ cat /etc/os-release\nNAME=\"Alpine Linux\"\nID=alpine\nVERSION_ID=3.12.7\nPRETTY_NAME=\"Alpine Linux v3.12\"\nHOME_URL=\"https://alpinelinux.org/\"\nBUG_REPORT_URL=\"https://bugs.alpinelinux.org/\"\n$ ls -la /root/.cache/mongodb-binaries\n-rwxr-xr-x    1 root     root      62824944 Jul 28 13:15 mongod-x64-alpine-4.0.25\n\n$ node --inspect testMongodserverMemory.js\nDebugger listening on ws://127.0.0.1:9229/e36e5b7e-f78b-4b2b-80d2-7387e33f9a0c\nFor help, see: https://nodejs.org/en/docs/inspector\nStarting the instance failed, enable debug for more information\n/builds/n_DqkLj7/0/di4b/projects/......../node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:233\n            throw new Error('Spawned Mongo Instance PID is undefined');\n                  ^\nError: Spawned Mongo Instance PID is undefined\n    at MongoInstance._launchMongod (/builds/n_DqkLj7/0/di4b/projects/............../node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:233:19)\n    at MongoInstance.<anonymous> (/builds/n_DqkLj7/0/di4b/projects/................/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:147:39)\n    at Generator.next (<anonymous>)\n    at fulfilled (/builds/n_DqkLj7/0/di4b/projects/.................../node_modules/tslib/tslib.js:114:62)\n
\n

my test

\n
const {MongoMemoryServer} = require('mongodb-memory-server');\nlet myPromise = new Promise(async function (myResolve, myReject) {\n    console.log(\"before MongoMemoryServer create\")\n    let mongo = await MongoMemoryServer.create();\n    if (mongo) {\n        myResolve(mongo);\n    } else {\n        myReject(mongo);\n    }\n});\nmyPromise\n    .then(async function (mongo) {\n        console.log(mongo)\n        await mongo.stop()\n    })\n    .catch(function (error) {\n        console.log(error);\n    })
","upvoteCount":1,"answerCount":3,"acceptedAnswer":{"@type":"Answer","text":"

Alpine linux is not supported, because mongodb does not provide binaries for this as can be seen in #347

\n

current workaround for docker: #347 (comment)

\n

btw, you did not provide what versions are used

","upvoteCount":1,"url":"https://github.com/typegoose/mongodb-memory-server/discussions/516#discussioncomment-1082863"}}}
Discussion options

You must be logged in to vote

Alpine linux is not supported, because mongodb does not provide binaries for this as can be seen in #347

current workaround for docker: #347 (comment)

btw, you did not provide what versions are used

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@mbsophia
Comment options

@hasezoey
Comment options

Answer selected by hasezoey
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants