test-with-coverage is broken on node v16
envgap__shelljs__shelljs-1130
01 / FAILURE SIGNATURE
As reported upstream
### Example ShellJS command to reproduce the error:
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
e7ce4df63f174a7e368a0bc76c592fb5fe02357e- Manifest
package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
shelljs/shelljs #1130 · read the original issue
<!--
Before posting your issue, please check our FAQ:
https://github.com/shelljs/shelljs/wiki/FAQ
-->
### Node version (or tell us if you're using electron or some other framework):
v16, v18, or v20
### ShellJS version (the most recent version/Github branch you see the bug on):
`main` git branch
### Operating system:
All
### Description of the bug:
It looks like CI is broken right now. It appears that `nyc` is running into a bug on node v16, v18, and v20. See this CI run for an example: https://github.com/shelljs/shelljs/actions/runs/5956710281/job/16287478757?pr=1129. Here's the main stack that I see:
```
/home/runner/work/shelljs/shelljs/node_modules/append-transform/index.js:1
TypeError [ERR_INVALID_ARG_TYPE]: The "mod" argument must be an instance of Module. Received an instance of Module
at new NodeError (node:internal/errors:387:5)
at makeRequireFunction (node:internal/modules/cjs/helpers:74:11)
at Module._compile (node:internal/modules/cjs/loader:1188:19)
at Module.replacementCompile (/home/runner/work/shelljs/shelljs/node_modules/append-transform/index.js:58:[13](https://github.com/shelljs/shelljs/actions/runs/5956710281/job/16287478757?pr=1129#step:5:14))
at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at /home/runner/work/shelljs/shelljs/node_modules/append-transform/index.js:62:4
at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at /home/runner/work/shelljs/shelljs/node_modules/append-transform/index.js:62:4 {
code: 'ERR_INVALID_ARG_TYPE'
```
This appears to have regressed recently, so maybe this is a change in the latest node LTS versions.
### Example ShellJS command to reproduce the error:
N/A. This reproduces with `npm run test-with-coverage`.04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]