[BUG] Log failed GET attempts without having to change log level
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
The registry is down at the moment, but when you run npm install, it just hangs forever without giving any indication that something is going wrong.
When I run npm --loglevel verbose install, I suddenly see that there are failed queries, and only then proceed to check https://status.npmjs.org/ to see that there is a registry issue.
This is not really helpful for most people, and you have to know this --loglevel flag to even begin to understand why nothing is happening in your terminal.
Here are some of the logs that I see when using verbose:
npm http fetch GET https://registry.npmjs.org/@turbo%2fworkspaces attempt 1 failed with 504
npm http fetch GET https://registry.npmjs.org/@turbo%2fworkspaces attempt 2 failed with 504
npm http fetch GET https://registry.npmjs.org/@turbo%2fworkspaces attempt 3 failed with 504
npm http fetch GET 504 https://registry.npmjs.org/@turbo%2fworkspaces 122114ms attempt #3 (cache skip)
It would seem normal to me to alert the developer that his npm install command is hitting 5xx errors without having to change log levels.
Expected Behavior
I expect to see failed GET requests as info or error logs, and not verbose.
Steps To Reproduce
No response
Environment
- npm: 10.8.2
- Node.js: 20.18.1
- OS Name: macOS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the registry failure with npm install and compare its output with npm --loglevel verbose install, using the failed GET examples as the expected evidence. Trace the npm CLI request logging path and verify that 5xx GET failures are visible at the normal log level without requiring verbose logging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100