Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!