You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm retries idempotent read requests to the registry (ref). But it doesn't log the intermediate errors, regardless of loglevel.
Logging every http response or network failure would aid investigations. For example, if npm install is slow, it would useful to know why initial attempts failed, and how long individual http requests took.
Expected Behavior
Every http response or network failure is logged when the loglevel is verbose or higher.
Steps To Reproduce
Intentionally using https://httpbin.org for fault injection. When the supplied package name, 503, is appended to https://httpbin.org/status, that causes our "registry" to return a 503 status code, a retryable response.
npm view 503 --loglevel silly --registry=https://httpbin.org/status --fetch-retries=2 (2 retries is the default)
The command will fail with error 503 SERVICE UNAVAILABLE. That's expected.
Inspect the log output. You'll see there were three attempts to retrieve package details, but only the final 503 http response is recorded. Log snippet:
31 silly logfile done cleaning log files
32 http fetch GET 503 https://httpbin.org/status/503 80700ms attempt #3 (cache skip)
33 timing command:view Completed in 80705ms
34 verbose stack HttpErrorGeneral: 503 SERVICE UNAVAILABLE - GET https://httpbin.org/status/503
Environment
npm: npm@10.5.2
Node.js: node@v20.12.2
OS Name: macOS 14.4.1
System Model Name: MacBook Air 15"
npm config:
; "user" config from /Users/hashtagchris/.npmrc
@npm:registry = "https://npm.pkg.github.com"
//npm.pkg.github.com/:_authToken = (protected)
//registry-sandbox.npm.red/:_authToken = (protected)
//registry.npmjs.org/:_authToken = (protected)
logs-max = 1000
; node bin location = /Users/hashtagchris/.nvm/versions/node/v20.12.2/bin/node; node version = v20.12.2; npm local prefix = /Users/hashtagchris/r/npm; npm version = 10.5.2; cwd = /Users/hashtagchris/r/npm; HOME = /Users/hashtagchris; Run `npm config ls -l` to show all defaults.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm retries idempotent read requests to the registry (ref). But it doesn't log the intermediate errors, regardless of loglevel.
Logging every http response or network failure would aid investigations. For example, if
npm install
is slow, it would useful to know why initial attempts failed, and how long individual http requests took.Expected Behavior
Every http response or network failure is logged when the loglevel is
verbose
or higher.Steps To Reproduce
Intentionally using https://httpbin.org for fault injection. When the supplied package name,
503
, is appended to https://httpbin.org/status, that causes our "registry" to return a 503 status code, a retryable response.npm view 503 --loglevel silly --registry=https://httpbin.org/status --fetch-retries=2
(2 retries is the default)error 503 SERVICE UNAVAILABLE
. That's expected.503
http response is recorded. Log snippet:Environment
npm@10.5.2
node@v20.12.2
The text was updated successfully, but these errors were encountered: