brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: npm config list shows which config file set each npm option

Config
~/tips/tip-config-npm-config-list

npm config list

See the active npm settings grouped by the file they come from.

npm reads settings from several places, so a strange registry or an unexpected default can be hard to trace. One command shows what is in effect and where it came from.

Run it inside the project that misbehaves:

npm config list

The output is split into blocks, each headed by a comment naming the source:

; "project" config from /home/me/app/.npmrc

save-exact = true

You’ll see separate blocks for the project file, your user file, and the global or built-in ones when they set something. That makes it obvious when a forgotten .npmrc in a repository is overriding your own preference. To ask for a single value:

npm config get registry

And to see every setting including the defaults, add -l:

npm config ls -l

That last list is long, so I pipe it through grep or a pager.

Run it from the right folder, because the project file only counts when you’re inside that project. Settings can also come from environment variables that start with npm_config_, which are easy to overlook in a CI job. And glance over the output before pasting it into an issue: registry addresses and internal paths can be things you’d rather not publish.

Further reading: npm config documentation

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Config tips include extraconfig.txt root = true –smart-case define( 'WP_HOME', 'https://example.com' ); jellyfin --cachedir /srv/jellyfin-cache All Config tips (9) All topics

Link