digitalbazaar / digitalbazaar/http-client

Error: Cannot find module 'node:process'; Only supports 14.18.0 or newer

Open
#28 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2
Forks
8
PR merge metrics
No merged PRs in 30d

Description

When updating jsonld from 5.2.0 to 6.0.0, we started getting the following error when running our tests:

Error: Jest: Got error running globalSetup - C:\repos\project\jest.setup.js, reason: Cannot find module 'node:process'
Require stack:
- C:\repos\project\node_modules\@digitalbazaar\http-client\dist\cjs\index.cjs        
- C:\repos\project\node_modules\jsonld\lib\documentLoaders\node.js
- C:\repos\project\node_modules\jsonld\lib\platform.js
- C:\repos\project\node_modules\jsonld\lib\jsonld.js
- C:\repos\project\node_modules\jsonld\lib\index.js
...

This happened when using Node 14.16.1.

Apparently Node didn't start supporting the node: prefix syntax until v16.0.0 and 14.18.0. See the history section at https://nodejs.org/dist/latest-v18.x/docs/api/modules.html#core-modules.

The GitHub actions for this project are being run with 14.19.2 according to https://github.com/digitalbazaar/http-client/runs/6513550578 and newer runs.

So, the project really only supports v14.18.0 or above; not 14.x.

I think removing the node: prefix would then allow all versions of node v14 to be supported, unless there is something else incompatible too.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the node:process usage implicated by the @digitalbazaar/http-client stack and check how Node versions are declared for the project. Reproduce the failure on Node 14.16.1, then run the test suite on Node 14.18.0 or newer. Done means Node 14.16.1 no longer fails with Cannot find module 'node:process' without breaking newer Node runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.