curl https://www.npmjs.com/ returns 403
#174098
-
Select Topic AreaQuestion BodyHi. I've noticed that something within the last 24 hours, HTTP requests to any path on The same request works in the browser -- i.e. the same request from Firefox (and observing in the Web Dev Tools "Network" panel) receives an HTTP 200 response. I've attempt to reproduce the same request Firefox was making by using the same headers in the FWIW, this is breaking linking checking in docs for the https://github.com/open-telemetry/opentelemetry-js repo. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
TL;DR: Within the last ~24 hours, the npm website ( Step‑by‑step: what’s happening and how to fix it1) What changed
2) Why copying Firefox headers doesn’t workCloudflare’s bot defenses check far more than headers:
3) Options for CI and docs link checkingA) Prefer API endpoints (recommended for reliability)Use these for existence/metadata checks without touching the website: # Package existence via the npm registry (JSON)
curl -sS -I https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-grpc
# Full package metadata (percent-encode the slash)
curl -sS https://registry.npmjs.org/%40opentelemetry%2Fexporter-metrics-otlp-grpc | head -n 20
# NPMS metadata (useful for docs/link verification that a package exists)
curl -sS https://api.npms.io/v2/package/%40opentelemetry%2Fexporter-metrics-otlp-grpc | head -n 20If your docs currently link to B) Tell your link checker to accept/skip
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
I am using a browser, however I have to use a VPN to access https://www.npmjs.com/, but now I got 403 error partially.
Could this be solved? |
Beta Was this translation helpful? Give feedback.

TL;DR: Within the last ~24 hours, the npm website (
https://www.npmjs.com/*) began enforcing stricter Cloudflare Bot Management. Non‑browser clients (e.g.,curl, link checkers, CI) now receive HTTP 403 with a__cf_bmcookie, while real browsers pass the challenge and get 200. This does not affect the registry APIs. For automation, either (A) use the registry/NPMS APIs, (B) treat 403 fromwww.npmjs.comas acceptable/skip those URLs, or (C) run a real browser (Playwright) for link checks. Avoid header hacks; they’re brittle and against the spirit of site policy.Step‑by‑step: what’s happening and how to fix it
1) What changed
curl -Itohttps://www.npmjs.com/package/@opentelemetry/exp…