“It works on my machine” is what a developer says when the code runs fine locally but fails in CI, on a teammate’s laptop or in production. It is usually true. It is also not the question anyone else is asking.
The cause is almost always a difference in environment. A different language or runtime version. A dependency that resolved to a newer release because there was no lockfile. An environment variable that exists on one laptop and nowhere else. A file named Config.ts imported as config.ts, which works on the default case-insensitive macOS file system and fails on Linux. A cache, a database row or a background service that only one machine has.
The fix is to make environments agree. Commit the lockfile. Pin runtime versions with a file like .nvmrc or .tool-versions. Keep a .env.example that lists every variable the app needs. For larger setups, containers or dev containers give everyone the same operating system and tools. Treat CI as the neutral machine: if it fails there, the bug is real.
When you hit it, compare instead of guessing. Print versions on both machines. Do a clean install. Run the exact command CI runs. The difference is usually in the first three things you check.
Saying it is not a defense, and nobody should treat it as one. It is a useful data point that narrows the search to whatever is different.
The shirt states the fact across two rows. It does not say which machine.
In the wild
Works on my machine, which tells us it’s environment. CI is on Node 20 and I’m on 22. Checking that first.


