sindresorhus / p-memoize

Memoize promise-returning & async functions
MIT License
396 stars 30 forks source link

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module (Node.js v15.14.0) #33

Closed salisbury-espinosa closed 3 years ago

salisbury-espinosa commented 3 years ago

$ node Welcome to Node.js v15.14.0. Type ".help" for more information.

const pMemoize = require('p-memoize');

Uncaught: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: node_modules/p-memoize/dist/index.js

sindresorhus commented 3 years ago

The error is correct.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c