fetch is not a function · Issue #1851 · node-fetch/node-fetch · GitHub
Skip to content

fetch is not a function #1851

Description

@cmdparkour

when i install node-fetch and using const fetch = require('node-fetch');
but when i using the fetch, it's wrong, and the message is fetch is not a function

Reproduction

Steps to reproduce the behavior:
const nodefetch = require('node-fetch');
const siteInfoRes = await nodefetch(fetchUrl, {
method: 'GET',
headers: {
'Authorization': Bearer ${TOKEN}
},
params: {
siteId: SITE_ID,
}
});

Expected behavior

Screenshots

Your Environment

software version
node-fetch 3.3.2
node 22.16.0
npm usnig pnpm the last version
Operating System

Additional context

Activity

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