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

174
Visualizações
node-fetch ignores query string with commander.js

I created a CLI with commander.js that I have published via npm. The CLI uses node-fetch to request data from an API. However, for some users of my CLI, node-fetch is ignoring the query string in my fetch URL.

My assumption is that the some users have an older version of node-fetch installed and it is using that version instead of the explicit version in my dependencies list in package.json.

If this is the reason, how can I ensure that the correct version of node-fetch is used with my CLI?

Are there any other reasons you can think of that would cause some environments to ignore the query string?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

To assert this problem you can write tests. Then execute those tests using different versions of node-fetch to see if that's really the problem.

A simpler way to solve it (assuming it is the real problem), could be to set the exact version of node-fetch that you want your users to install in your package.json, using npm's versioning notation.

So, for example:

  • "1.0.0" Must match version exactly
  • ">1.0.0" Must be greater than version
  • ">=1.0.0" Etc.
about 4 years ago · Juan Pablo Isaza Relatório
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