logo

Why is NPM Fetching a Dependency Not in My package-lock.json?

ID: 33f444f0-4bd8-5215-a173-0388ed2f6a3a

STIX ID: report--33f444f0-4bd8-5215-a173-0388ed2f6a3a

Feed Name: HackerOne Blog

Date Published: 2024-01-25

Date Updated: 2026-06-12

...
...

This document explains why npm may fetch dependencies that are not present in your `package-lock.json`, covering causes such as dependencies pulled from GitHub (which may require building and thus pull devDependencies), local file path dependencies, and peer dependencies. It provides mitigation steps including reviewing `package.json`, running `npm audit`, keeping dependencies updated, and using `npm ls` to trace dependency origins.

Your team is not currently subscribed to this feed. You must subscribe to it in order to see this post.