NinjaOps Fixes
/
Node.js
Node.js Fixes
10 troubleshooting guides — each with the error, why it happens, and copy-paste commands to fix it.
npm ERR! code ENOTFOUND / network — Registry Failures in CI
— npm couldn't reach the registry (ENOTFOUND, ECONNREFUSED, ETIMEDOUT) or the request failed mid-transfer (EINTEGRITY after corrupt cache).
ECONNRESET in Node.js: Sockets Closed Under You
— ECONNRESET means the other end (or a middlebox) closed the TCP connection abruptly.
Node.js 'JavaScript heap out of memory' (FATAL ERR)
— V8 caps the heap (~4GB on 64-bit, less by default in some builds).
npm ERR! code ELIFECYCLE — The Script Failed, npm Is Just the Messenger
— ELIFECYCLE means a package.
Node.js "EADDRINUSE: address already in use" — Find and Free the Port
— Something already listens on that port — usually a previous instance of your own dev server that never died.
Node.js "Cannot find module" — Path, Deps, or Case Sensitivity
— Three different problems share one message: a missing dependency, a relative path typo, or a case-sensitivity mismatch that works on macOS/Windows and fails on Linux.
Node.js "ERR_REQUIRE_ESM" — require() Against an ESM-Only Package
— The package you required ships only ES modules; require() can't load it.
npm ERR! code EACCES — Cache and Prefix Permission Wars
— npm tried to write ~/.
Node.js "ERR_OSSL_EVP_UNSUPPORTED" — Old Crypto in New Node (Webpack Classic)
— Node 17+ ships OpenSSL 3, which removed the legacy MD4 hash webpack (and some older tooling) uses.
npm ERR! ERESOLVE: Peer Dependency Conflict
— Two packages demand incompatible versions of a shared peer (React 17 vs 18 is the classic).