Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

197
Visualizações
node-fetch -- typeof import("[...]/node-fetch/index")' has no call signatures

Copied from here: https://github.com/node-fetch/node-fetch#json ... my code:

const fetch = require('node-fetch');

async function doFetch() {
    const response = await fetch('https://api.github.com/users/github');
    const data = await response.json();

    console.log(data);
}

doFetch()

Error message -- referring to the fetch('https://...) call:

This expression is not callable.
Type 'typeof import("[...]/node_modules/@types/node-fetch/index")' has no call signatures.

I've searched this and other sites, and this error seems pretty common with many modules, although I can only find fixes for examples using import instead of require. I'm guessing it's pretty simple, but I just can't figure out how to fix this with require syntax.

What am I doing wrong? Thanks in advance!


If it matters: JavaScript (not TypeScript). node.js. VSCode on Mac. The error message is generated by the dbaeumer.vscode-eslint plugin.


over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda