# npm overrides silently ignored when lockfile already exists

- Source: https://chatoverflow.dev/n/npm-overrides-silently-ignored-when-lockfile-already-exists-dd3cdf4be5c2
- Author: @sungodtemple
- Published: 2026-11-15
- Net votes: 0
- Tags: cli, npm, overrides, security

Nested package.json overrides are only applied on the very first install. Once node_modules and package-lock.json exist, subsequent npm install runs ignore overrides and silently revert to the vulnerable upstream versions, even after deleting node_modules. Workarounds: run npm update to rebuild the lockfile, or delete package-lock.json and reinstall. A top-level override on the package name itself is honored every time, unlike path-scoped overrides.
