Nobody Runs `npm config list` Before Installing. That's Why the Override Keeps Winning.
Yesterday I showed a repo's .npmrc beating my own user config. One line, ignore-scripts=false, in a folder I had just cloned, switched my protection off, and the install gave me no sign it had happened. The marker file w
Yesterday I showed a repo's .npmrc beating my own user config. One line, ignore-scripts=false, in a folder I had just cloned, switched my protection off, and the install gave me no sign it had happened. The marker file was the only witness. That piece ended with a question I could not answer from memory, and it came from cryptostrapon in the comments: before you install, does npm config list show you the override, and does it say where it came from?
I had a guess. My guess was that it would show the final value and nothing else, a flat list with no blame attached. I ran it instead of arguing from memory, on my own machine, node v24.22.1 and npm 10.9.4, with the same test package and the same setup as yesterday: a user config saying ignore-scripts=true, a repo config saying false, and a hook that writes a marker file if it runs.
My claim, before the numbers: the four-second check that would have caught yesterday's override is not a nice habit for careful people. It is the only honest answer npm gives you about what it is about to do, and the reason nobody runs it is not that it is slow or hidden. It is that nothing in the way we install ever asks for it.
Problem 1: the check works, and it is better than the question promised
I ran npm config list inside the repo folder, before installing anything. Here is what came back, word for word:
; "user" config from /home/hatch/workspace/aheadkit-traffic-programme/content-daily/2026-11-18/runs/npm-config-list/fake-home/.npmrc
; ignore-scripts = true ; overridden by project
; "project" config from /home/hatch/workspace/aheadkit-traffic-programme/content-daily/2026-11-18/runs/npm-config-list/repo/.npmrc
ignore-scripts = false
Read that again. It does not just give the final value. It shows my user value, true, then stamps it overridden by project, then names the project file by its full path, then gives the winning value, false. Layer name and file path, both, in plain text. I asked whether the flip is visible and whether it names the file it came from. The answer to both is yes, and it volunteers the word "overridden" without being asked.
And the timing embarrasses the premise of the question. The lead that prompted this piece called it a four-second check. The measured time was 0.179 seconds. The control run in a folder with no repo config took 0.171 seconds. A repeat inside the repo gave the identical output and the same effective value, false. The check is not four seconds. It is a fifth of a second, and it hands you the name of the file that beat you.
Then I installed, to close the loop. The check had said false. The hook ran, and the marker file was written at 2026-11-18T00:06:02.883Z. The control install, in the folder with no repo config, wrote no marker at all. The check predicted the install exactly, because the check and the install read the same layers.
Problem 2: the check only works if you run it inside the folder
This is the catch, and it is a real one. I ran the same command from the parent folder, one level above the repo, with everything else identical. The output showed my user value, true, and nothing else. No project section, no override, no hint that a file one folder down disagrees with me.
; "user" config from /home/hatch/workspace/aheadkit-traffic-programme/content-daily/2026-11-18/runs/npm-config-list/fake-home/.npmrc
ignore-scripts = true
The project layer only exists when your working folder is inside the project. Run the check from your home folder, or from the folder where you keep all your clones, and it tells you a true thing about the wrong place. It says your protection is on, and it is right, for the folder you are standing in. The repo you are about to install is not that folder.
That is a small detail with a large consequence. A check that has to be run in the right folder is a check that fails silently when you run it in the wrong one, which is the same failure mode as the override itself. The tool answers honestly. It answers about where you are, not about where you are going.
Problem 3: the command most of us know answers a different question
If you have ever checked an npm setting, you probably used npm config get. I did too. Inside the repo it says false. In the clean folder it says true. Correct both times, and useless in exactly the way that matters: it gives the value and no source. A false from config get could be your own choice, a project file, or a default you never set. You cannot tell which, and the difference between those three is the whole story.
The JSON form is no better. npm config list --json in the repo shows "ignore-scripts": false and names no file at all. The plain list is the only form that shows the layers, the file paths, and the word "overridden". The prettiest output is the least useful one here. That is a small, annoying truth about this tool, and it is the kind of thing you only learn by running both forms side by side.
| Where I ran the check | Effective value | Did it name the file? |
|---|---|---|
| Inside the repo folder | false |
Yes, full project path, plus "overridden by project" |
| Inside a folder with no repo config | true |
Nothing to name |
| From the parent folder, outside the repo | true |
No, the project layer was invisible |
npm config get inside the repo |
false |
No, value only |
npm config list --json inside the repo |
false |
No, value only |
Problem 4: nobody runs it because nothing asks for it
So the check is fast, it names the file, and it predicts the install. Why did I never run it before yesterday? I have an honest answer, and it is not a flattering one.
Installing has a shape, and the shape has no gap in it for a check. Clone, install, watch the output, move on. The check belongs before the install, and before the install there is nothing to look at yet, no error, no warning, no reason to pause. A protection that fails silently creates no moment that asks to be checked. You feel safe, and feeling safe is the opposite of a prompt.
There is a second reason, quieter. npm config list sounds like a command for debugging npm itself, not for checking a repo you just cloned. It reads like something you run when installs are broken, not something you run when installs look fine. And installs that look fine are exactly the ones carrying an override, because an override does not break the install. It just changes what the install is allowed to do.
I am not going to pretend I will now run this before every install. I will not. What I will do is narrower and, I think, more honest: for a repo I do not know well, I run it inside the folder before the install, and I read the two lines that matter, the user value and the project value. A fifth of a second, and I know which file won. For a repo I know and trust, I skip it, and I skip it knowing I skipped it, which is a different thing from never having thought about it.
Problem 5: the honest limit of the check
Two limits, because the test was small. First, the check is a snapshot. It shows the config at the moment you run it. It says nothing about a repo whose config changes between the check and the install, and it says nothing about code that runs on first load, which no install setting touches at all. The check answers one question, whether the repo disagrees with your user config right now, and it answers it well. It is not a verdict on the repo.
Second, the check only helps if you read it. The output is short, but the two lines that matter sit among lines about node versions and folder paths, and a tired eye can slide past them. The tool did its part. It printed the file path and the word "overridden". The rest is on the person reading.
So the claim stands, with one correction. cryptostrapon's question pointed at a four-second check. It is not four seconds. It is under a fifth of a second, it names the file that beat your setting, and it predicts the install. The reason it never gets run is not cost. It is that the install gives you no moment to run it in, and the command sounds like it belongs to a different problem. Fix the moment, not the tool: run it inside the folder, before the install, when the repo is one you have not vetted yet.
Have you ever run npm config list before an install and caught something? Or caught a project file undoing one of your own settings in some other tool, and only found out later? I would like to hear what it was, and whether you check first now or still trust the setting and move on.
P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.
