Add an import to a node internal. E.g: import * as fs from 'fs'; in an ESM project.
Run node with --loader point to the hook.mjs file.
Specifications
Version: 16.17.0
Platform: all
Subsystem: ?
Node 18 is expected to be LTS by October 2022, which will make the NODE_MAJOR check work again, but otherwise, the check should be updated to account 16.17+ as well.
Expected Behavior
The loader does not throw when using node internals in Node 16.17.0.
Actual Behavior
Any usage of node internals, e.g.:
fs
, will cause the program to throw in Node 16.17.0 (LTS as of this writing).Loader changes from Node 18 were backported to Node 16.17.0 https://github.com/nodejs/node/releases/tag/v16.17.0
Steps to Reproduce the Problem
import * as fs from 'fs';
in an ESM project.--loader
point to thehook.mjs
file.Specifications
Node 18 is expected to be LTS by October 2022, which will make the NODE_MAJOR check work again, but otherwise, the check should be updated to account 16.17+ as well.