PatchVault › Errors › request → native fetch

npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

npm shows this for request-promise and request-promise-native, which wrap the deprecated request package.

Check your code free (runs in your browser)

The box is pre-filled with a sample that triggers this error. Paste your own file to check it. Nothing leaves this page.

Or scan your whole repo locally (free, stdlib Python, read-only):

python3 <(curl -fsSL https://patchvault-81y.pages.dev/starters/request-fetch-scan.py) .
Get the request → native fetch auto-fixer: $9 one-time

Why it happens

request-promise 4.2.6 is the last release. Promise-style calls map almost one-to-one onto async fetch.

Manual fix

// before
const rp = require('request-promise')
const body = await rp({ uri: url, json: true })
// after
const res = await fetch(url)
if (!res.ok) throw new Error(`HTTP ${res.status}`)
const body = await res.json()

Verify

Re-run your install/build and re-scan the file above. The finding should be gone. The paid fixer applies the same change across a repo: --dry-run shows the diff, --apply keeps a .bak of each file, and --rollback restores them.

Sources

Related errors

Full guide and free terminal scanner: request → native fetch. Last checked 2026-10-31.