Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Subql Cli failed issue Error: require() of ES Module.. #1211

Unanswered
jiqiang90 asked this question in SDK issues
Discussion options

If you have encounter with issue when using subql command line tool,

Error: require() of ES Module .../project/node_modules/node-fetch/src/index.js from .../project/node_modules/native-fetch/src/index.js not supported.
 Instead change the require of .../project/node_modules/node-fetch/src/index.js in .../project/node_modules/native-fetch/src/index.js to a dynamic import() which is available in all CommonJS modules.
 Code: ERR_REQUIRE_ESM

this is due to one of the cli tool dependencies node-fetch has been updated and only support ES module from 3.x.x

To fix this:

  • If you are on cli 1.3.0, please update the 1.3.1 to resolve this issue.
  • if you used npm for install, you can change to yarn to fix this issue.
  • if this issue remains in your subquery project, you can add node-fetch: 2.6.7 to your package.json, also use resolution to fix the version.
  • more questions please leave message below or contact us directly on Discord technical support.
You must be logged in to vote

Replies: 0 comments

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

AltStyle によって変換されたページ (->オリジナル) /