Four Coding Errors: How I Diagnose Them Before Touching the Fix
A diagnosis-first guide to Node OpenSSL errors, missing npm modules, occupied ports, and Git conflicts.
0xNN · · 6 min read
Four Coding Errors: How I Diagnose Them Before Touching the Fix
The quickest way to lose an afternoon is to copy the first command under a scary error. I have done it with Node, npm, ports, and Git. Sometimes the command hides the symptom without fixing the cause.
My rule now is simple: collect one piece of evidence, make the smallest change, then run the command that proves it worked.
ERR_OSSL_EVP_UNSUPPORTED
This often appears when an old build dependency meets Node versions using OpenSSL 3. Check the runtime and dependency tree first:
~bash
node --version
npm ls
npm outdated
~
The familiar workaround is node --openssl-legacy-provider. It may open a legacy project, but it re-enables old algorithms. Treat it as a migration bridge, not a permanent production setting. Check the project Node version, update the bundler or dependency, and build again without the flag.
Module not found
Do not delete the lockfile by reflex. Check whether the package is installed in the workspace that imports it:
~bash
npm ls package-name
node -p "require.resolve('package-name')"
~
For a clean install that respects an existing lockfile, remove only node_modules and run npm ci. Use npm install package-name when the dependency is genuinely missing. In a monorepo, declare it in the package that imports it. npm cache verify is a better first step than clearing the whole cache.
EADDRINUSE
A process is already listening on the port. Find it before stopping it.
~powershell
Get-NetTCPConnection -LocalPort 3000 -State Listen
Get-Process -Id
Stop-Process -Id
~
Use a different port if that process is intentional. Reserve forced termination for a process that ignores a normal shutdown.
Git merge conflicts
Conflict markers mean Git needs a decision, not that the repository is broken:
~bash
git status
git diff --name-only --diff-filter=U
~
Resolve each file, run its tests, and stage only inspected files. Use git merge --abort when the merge itself should be cancelled. Avoid destructive reset commands when unrelated work is in the tree.
A good fix is not the shortest command. It is the smallest change that removes the cause and leaves evidence you can explain.
References
• Node.js 17 release notes: OpenSSL 3
• Node.js CLI documentation
• npm cache documentation
• npm install documentation