Skip to content
Latchkey

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 output
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.

.npmrc / Terminal
# old
production=true
# new
omit=dev

# old flag
npm ci --production
# new flag
npm ci --omit=dev

Audit .npmrc against the installed npm

  1. List effective config with npm config ls -l and look for deprecated keys.
  2. Update both committed .npmrc and CI flags together.
  3. Re-run to confirm the warnings are gone and behavior is unchanged.

How to prevent it

  • Keep .npmrc aligned with the npm version in CI.
  • Replace --production with --omit=dev in scripts.
  • Review config warnings when bumping npm.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →