npm "warn config … deprecated" - Fix Deprecated .npmrc Settings in CI
These warnings mean your .npmrc (or install flags) still use settings newer npm has deprecated. They do not fail the build by themselves, but they signal config that may stop working, and they clutter logs.
What this error means
Every npm command prints npm warn config <key> ... deprecated, naming an old setting and its replacement. The install still runs, but the deprecated key may be silently ignored or behave differently than intended.
npm warn config production Use `--omit=dev` instead.
npm warn config cache-min This option is deprecated and will be removed.
npm warn config optional Use `--omit=optional` to exclude optional dependencies.Common causes
Legacy .npmrc keys
Settings like production=true, cache-min, or optional were valid in older npm and are now deprecated in favor of omit/include and other current keys.
Old install flags in CI scripts
CI scripts still passing --production or other deprecated flags trigger the warning on every run.
How to fix it
Migrate to current config keys
Replace deprecated keys with their modern equivalents.
# old
production=true
# new
omit=dev
# old flag
npm ci --production
# new flag
npm ci --omit=devAudit .npmrc against the installed npm
- List effective config with
npm config ls -land look for deprecated keys. - Update both committed
.npmrcand CI flags together. - Re-run to confirm the warnings are gone and behavior is unchanged.
How to prevent it
- Keep
.npmrcaligned with the npm version in CI. - Replace
--productionwith--omit=devin scripts. - Review config warnings when bumping npm.