Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module #24

Closed
fengxinming opened this issue Apr 22, 2021 · 1 comment
Closed

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module #24

fengxinming opened this issue Apr 22, 2021 · 1 comment

Comments

@fengxinming
Copy link

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/jesse/workspace/ipack/packages/ipack/node_modules/_read-pkg@6.0.0@read-pkg/index.js
require() of ES modules is not supported.
require() of /Users/jesse/workspace/ipack/packages/ipack/node_modules/_read-pkg@6.0.0@read-pkg/index.js from /Users/jesse/workspace/ipack/packages/ipack/bin/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /Users/jesse/workspace/ipack/packages/ipack/node_modules/_read-pkg@6.0.0@read-pkg/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/jesse/workspace/ipack/packages/ipack/node_modules/_read-pkg@6.0.0@read-pkg/package.json.
@sindresorhus
Copy link
Owner

Please read the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants