Visitar URL original
Error [ERR_REQUIRE_ESM]: require() of ES Module · Issue #1809 · node-fetch/node-fetch · GitHub
Skip to content

Error [ERR_REQUIRE_ESM]: require() of ES Module #1809

Open

Description

@zhaoyiming0803

Reproduction

Steps to reproduce the behavior:

  1. npm install --save node-fetch
  2. import fetch from 'node-fetch'
  3. error in terminal: Error [ERR_REQUIRE_ESM]: require() of ES Module

Expected behavior

Screenshots

Your Environment

software version
node-fetch 3.3.2
node 16.14.2
npm 8.5.0
Operating System Mac

Additional context

Activity

  1. mtio commented on May 15, 2025

    @mtio

    Still an issue

    node-fetch: 3.3.2
    Node: v18.20.4
    Npm: 10.7.0
    OS: Mac

  2. sharaalt commented on Jun 14, 2025

    @sharaalt

    I still have this problem

    node-fetch: 3.3.2
    Node: v20.17.0
    NPM: 10.8.3

    However when I removed the line it fixed the issue and didn't break anything for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions