npm & Node.js errors
- Error [ERR_MODULE_NOT_FOUND]: Cannot find moduleIn ES modules, Node needs the full file path including the .js extension. Add the extension to your import or install the missing package.
- Error [ERR_REQUIRE_ESM]: require() of ES Module not supportedYour CommonJS code calls `require()` on a package that is ESM-only (node-fetch 3, chalk 5, nanoid 4, got 12, p-limit 4 and others). Use `import`, a dynamic `import()`, the last CommonJS version of the package, or Node 22.12+ which can require most ES modules.
- Error: Cannot find moduleNode can't find a package or file you required. Install the dependency, fix the path, or check you're running from the right folder.
- Error: ENOSPC: System limit for number of file watchers reachedOn Linux, your dev server (webpack, Vite, Jest, nodemon, VS Code) ran out of inotify watches. It's not about disk space — raise fs.inotify.max_user_watches or watch fewer files.
- Error: error:0308010C:digital envelope routines::unsupportedAn old webpack (often via react-scripts 4 or Vue CLI 4) uses the MD4 hash, which OpenSSL 3 in Node 17+ disables. Upgrade webpack/react-scripts, or use the legacy OpenSSL provider.
- Error: listen EADDRINUSE: address already in use :::3000Another process (often an old copy of your own dev server) is already listening on that port, so Node can't bind to it. Stop that process or use a different port.
- FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memoryNode's V8 engine ran out of the heap memory it is allowed to use. Common during big webpack/Vite/Next.js/TypeScript builds. Raise the limit with --max-old-space-size or reduce memory usage.
- gyp ERR! find PythonA package with a native C/C++ addon (bcrypt, sqlite3, node-sass, canvas...) is being compiled with node-gyp, which needs Python and a C++ compiler, and it couldn't find a usable Python.
- npm ERR! code E404 - Not Foundnpm couldn't find the package (or version) in the registry it asked. Typo in the name, a private/scoped package without auth, a wrong registry in .npmrc, or a version that was never published.
- npm ERR! code EACCESnpm can't write to the global install folder. Don't use sudo; point npm's global prefix at your home directory or use a Node version manager.
- npm ERR! code ELIFECYCLEAn npm script exited with an error. ELIFECYCLE itself is not the problem — the real error is printed above it.
- npm ERR! code EPERM operation not permittedThe operating system refused a file operation (rename, unlink, mkdir) npm needed. On Windows it's almost always a file locked by a running process, antivirus or an editor; elsewhere it's ownership or a read-only/synced folder.
- npm ERR! code ERESOLVE unable to resolve dependency treeA package's peer dependency doesn't match the version you have installed. Upgrade the package, or install with --legacy-peer-deps.
- npm ERR! enoent Could not read package.jsonYou ran npm in a folder without a package.json. cd into your project, or create one with npm init.
- npx: command not foundThe shell can't find the npx executable. Node.js isn't installed, was installed without npm (some distro packages), or its bin directory isn't on your PATH (common with nvm in new shells, CI and IDE terminals).