I was running tests today against p-queue (^7.0.0), but I've been unable to require the module on Node.js.
I can reproduce this using the Node REPL, as follows:
Welcome to Node.js v14.15.4.
> require('p-queue');
Which will yield the following exception:
Uncaught:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /.../node_modules/p-queue/dist/index.js
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at REPL1:1:1
at Script.runInThisContext (vm.js:133:18)
at REPLServer.defaultEval (repl.js:484:29)
at bound (domain.js:413:15)
at REPLServer.runBound [as eval] (domain.js:424:12) {
code: 'ERR_REQUIRE_ESM'
}
I was running tests today against
p-queue
(^7.0.0
), but I've been unable to require the module on Node.js.I can reproduce this using the Node REPL, as follows:
Which will yield the following exception: