Some of the NPM modules utilise new feature of Node.js that is called modules, that is declared as:
{
...
"type": "module,
...
}
in package.json file. And the current implementation of checks, like:
node -e 'require("/nix/store/4dj4m2yanj5z1182ji9y47vir6w723bk-formdata-polyfill-4.0.10/lib")
doesn't work with that new module type.
I found that for the packages of the module type, this check would work:
node --input-type=module -e 'import "/nix/store/4dj4m2yanj5z1182ji9y47vir6w723bk-formdata-polyfill-4.0.10/lib/formdata.min.js"'
that is, the check needs to add --input-type=module option and specify the file explicitly.
Some of the NPM modules utilise new feature of Node.js that is called modules, that is declared as:
{ ... "type": "module, ... }in
package.jsonfile. And the current implementation of checks, like:doesn't work with that new
moduletype.I found that for the packages of the
moduletype, this check would work:that is, the check needs to add
--input-type=moduleoption and specify the file explicitly.