question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not work with Node.js v16

See original GitHub issue

This package only works with Node.js v12 & v14.

Here is the error in Node.js v16 environment:

> npx jest

Starting the instance failed, enable debug for more information
Error: Jest: Got error running globalSetup - /domain-impl-server/node_modules/@shelf/jest-mongodb/setup.js, reason: Instance Exited before being ready and without throwing an error!
    at MongoInstance.<anonymous> (/domain-impl-server/node_modules/@shelf/jest-mongodb/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:134:25)
    at Object.onceWrapper (node:events:514:26)
    at MongoInstance.emit (node:events:394:28)
    at MongoInstance.closeHandler (/domain-impl-server/node_modules/@shelf/jest-mongodb/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:275:14)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1067:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
krakrjakcommented, Oct 21, 2021

Turning on MONGOMS_DEBUG inside the container and manually running the tests gives the following error when trying to use the mongodb binary:

stderrHandler: ""/home/node/.cache/mongodb-binaries/mongod-x64-debian-4.0.25: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /home/node/.cache/mongodb-binaries/mongod-x64-debian-4.0.25)

This is really a nail in the coffin for using Mongo 4.0.X as Node 16 images default to Buster and you cannot install libcurl3 with SSL support in Debian 10 or 11 (dropped support for SSLv1.0 which is what MongoDB 4.0.X is looking for). If you are using MongoDB v4.4 or higher, there should be no issue with the updated libcurl4 versions.

I’m testing the node:16-stretch and node:16-stretch-slim image to see if they will work for me.

My apologies for continuing to update this closed ticket. It’s clear the issue is not with the code in this repo or the code in mongo-memory-server packages. I have a feeling many people will run onto this in the not-too-distant future and maybe this issue can save them some work.

3reactions
krakrjakcommented, Oct 22, 2021

Ultimately using the stretch image did work out. I was not able to make the stretch-slim image work. Both the node:16-stretch image and the node:16.11.1-stretch image worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm does not support Node.js v16.10.0 - Stack Overflow
I have installed nodejs v16.x from nodesource on ubuntu 20.04(latest). when i run 'npm -v' i get '8.1.2' back in console. So ...
Read more >
npm WARN npm does not support Node.js v16 error [Solved]
The error "npm WARN npm does not support Node.js vX.Y.Z" occurs when you have incompatible versions of npm and Node.js installed. To solve...
Read more >
Bringing forward the End-of-Life Date for Node.js 16
Do nothing. Node.js 16 will be at risk for any vulnerabilities in OpenSSL 1.1.1 for the last seven months of its lifetime.
Read more >
npm does not support Node.js v SOLVED - YouTube
How to solve npm does not support Node. js v16.10.0 You should probably upgrade to a newer version of node as we npm...
Read more >
How to fix 'npm does not support Node.js v14' error on ...
Uninstall node.js (Windows Add/Remove programs) · Manually delete the npm folder from your user profile (%APPDATA%/roaming/npm) · Install node.js ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found