Fix: Error: spawn ENOENT (Node.js child_process)
Fix Node.js 'Error: spawn ENOENT' from child_process.spawn(): PATH resolution, the Windows .cmd/.bat problem, and why shell: true is now discouraged (DEP0190).
94 articles
RSSFix Node.js 'Error: spawn ENOENT' from child_process.spawn(): PATH resolution, the Windows .cmd/.bat problem, and why shell: true is now discouraged (DEP0190).
Fix Node.js/Express 'Cannot set headers after they are sent to the client', usually a missing return, double next(), or a duplicate response.
Fix Node.js 'TypeError: fetch failed' by reading error.cause to find what really failed: DNS, a refused connection, a timeout, or a bad certificate.
Fix Node.js 'Error [ERR_REQUIRE_ESM]: require() of ES Module not supported' by checking your Node version, using dynamic import(), or converting to ESM.
Fix JavaScript 'RangeError: Maximum call stack size exceeded': find the runaway recursion, add a base case, fix accidental self-reference, and convert deep recursion to iteration.
Fix Node.js 'listen EADDRINUSE: address already in use': find and kill the process on the port (macOS, Linux, Windows), or run your server on a different port.
Fix pnpm 9.5+ catalog protocol errors — Cannot find catalog default, ERR_PNPM_CATALOG_ENTRY_INVALID_SPEC, stale lockfile state, and tool incompatibility with catalog: references in monorepos.
How to fix mise (formerly rtx) errors — activation hook not running, tool not found after install, .tool-versions vs .mise.toml, Python venv integration, idiomatic env loading, and trust prompts.
How to fix Mongoose errors — useNewUrlParser removed, strictQuery default flip, populate returning null, lean() losing methods, discriminator setup, transaction sessions, and TypeScript Document types.
How to fix Node.js file watching — fs.watch unreliable on Linux, missing events on save, recursive watch on Windows/macOS, chokidar polling fallback, ignoring patterns, debouncing, and EMFILE errors.
How to fix Node.js stream/promises pipeline errors — uncaught stream errors, backpressure ignored, AbortSignal not propagating, async iterators in pipeline, Transform stream object mode, and converting between Node and Web Streams.
How to fix Node.js built-in test runner errors — node --test not finding files, ESM vs CJS imports, TypeScript with --experimental-strip-types, mock.method isolation, coverage reporting, and watch mode setup.
How to fix tsx (TypeScript executor) errors — Cannot find module after upgrade, ESM .js extension required, tsconfig paths not respected, watch mode not restarting, --import vs --loader, VS Code debugger setup.
How to fix pnpm workspace errors — workspace:* not resolving, catalog versions out of sync, --filter not matching, peer deps unmet across packages, shamefully-hoist trade-offs, and publishConfig for releases.
How to fix Fastify issues — route 404 from plugin encapsulation, reply already sent, FST_ERR_VALIDATION, request.body undefined, @fastify/cors, hooks not running, and TypeScript type inference.
How to fix Puppeteer errors — navigation timeout exceeded, failed to launch browser process in Docker and CI, element not found, page crashed Target closed, memory leaks from unclosed pages, and waiting for dynamic content.
How to fix Meilisearch issues — index setup, document indexing, search configuration, filtering, facets, typo tolerance, and self-hosted deployment.
How to fix Nodemailer issues — SMTP configuration, Gmail OAuth2, TLS errors, connection timeouts, email not delivered, and using with Next.js or Express.
How to fix Temporal issues — worker setup, workflow and activity errors, schedule configuration, versioning, and self-hosted Temporal Server deployment.
How to fix Strapi v5 issues — permissions, content types, REST and GraphQL APIs, media uploads, webhooks, plugins, and deployment configuration.
How to fix AWS SQS issues — visibility timeout, message not delivered, duplicate messages, Dead Letter Queue configuration, FIFO queue ordering, and Lambda trigger problems.
How to fix Bun runtime issues — Node.js API compatibility, native addons (node-gyp), Bun.serve vs Node http, bun test differences from Jest, and common package incompatibilities.
How to fix Drizzle ORM issues — schema definition, drizzle-kit push vs migrate, relation queries with, transactions, type inference, and common PostgreSQL/MySQL configuration problems.
How to fix gRPC errors — UNAVAILABLE connection errors, DEADLINE_EXCEEDED, UNIMPLEMENTED, TLS setup, interceptors for error handling, and status code mapping.
How to fix OpenTelemetry issues — SDK initialization order, auto-instrumentation setup, OTLP exporter configuration, context propagation, and missing spans in Node.js, Python, and Java.
How to fix tRPC issues — router setup, type inference across packages, context injection, middleware, error handling, and common tRPC v10/v11 configuration mistakes.
How to fix NestJS Swagger UI not displaying — SwaggerModule setup, DocumentBuilder, decorators not appearing, guards blocking the docs route, and Fastify vs Express differences.
How to fix Node.js stream issues — pipe and pipeline errors, backpressure handling, Transform streams, async iteration, error propagation, and common stream anti-patterns.
How to fix Prisma enum errors — schema definition, database sync, TypeScript enum type mismatch, filtering by enum, and migrating existing enum values.
How to fix Express rate limiting not working — middleware order, trust proxy for reverse proxies, IP detection, store configuration, custom key generation, and bypassing issues.
How to fix GraphQL error handling — error extensions, partial data with errors, Apollo formatError, custom error classes, client-side error detection, and network vs GraphQL errors.
How to fix GraphQL subscriptions not receiving updates — WebSocket setup, subscription protocol, Apollo Client config, server-side pub/sub, authentication over WebSocket, and reconnection.
How to fix MongoDB schema validation errors — $jsonSchema rules, required fields, type mismatches, enum constraints, bypassing validation for migrations, and Mongoose schema conflicts.
How to fix NestJS dependency injection errors — module imports, provider exports, circular dependencies, dynamic modules, and the most common 'can't resolve dependencies' patterns.
How to fix NestJS ValidationPipe not validating requests — global pipe setup, class-transformer, whitelist and transform options, custom validators, and DTO inheritance issues.
How to fix Prisma connection pool errors — pool size configuration, connection leaks, serverless deployments, singleton pattern, query timeout, and pgBouncer integration.
How to fix NestJS guards not working — applying guards globally vs controller vs method level, JWT AuthGuard, metadata with Reflector, public routes, and guard execution order.
How to fix NestJS interceptors not being called — global vs controller vs method binding, response transformation, async interceptors, execution context, and interceptor ordering.
How to handle Node.js uncaughtException and unhandledRejection events — graceful shutdown, error logging, async error boundaries, and keeping servers alive safely.
How to fix the N+1 query problem in Prisma — using include and select for eager loading, fluent API pitfalls, DataLoader integration, and query logging to detect N+1 patterns.
How to fix Prisma transaction errors — interactive transactions vs $transaction array, error handling and rollback, nested transactions, timeout issues, and isolation levels.
How to fix Redis Pub/Sub issues — subscriber not receiving messages, channel name mismatches, connection handling, pattern subscriptions, and scaling with multiple processes.
How to fix Socket.IO CORS errors — server-side CORS configuration, credential handling, polling vs WebSocket transport, proxy setup, and common connection failures.
How to fix Express async route handlers not passing errors to the error middleware — wrapping async routes, using express-async-errors, global error handlers, and Node.js unhandledRejection events.
How to fix the GraphQL N+1 query problem — understanding why it happens, implementing DataLoader for batching, using query complexity limits, and selecting efficient resolver patterns.
How to fix Jest failing with 'Cannot use import statement outside a module' — configuring Babel transforms, using experimental VM modules, migrating to Vitest, and handling ESM-only packages.
How to fix NestJS circular dependency errors — using forwardRef, restructuring module dependencies, extracting shared services, and understanding the NestJS module system.
How to fix Node.js 'JavaScript heap out of memory' — increasing heap size, finding memory leaks with heap snapshots, fixing common leak patterns, and stream-based processing for large data.
How to fix TypeORM QueryFailedError, entity not found errors, relation issues, missing migrations, and connection configuration problems in Node.js and NestJS applications.
How to fix req.body being undefined in Express — missing body-parser middleware, wrong Content-Type header, middleware order issues, and multipart form data handling.
How to fix Prisma's 'Unique constraint failed on the fields' error — finding which field caused it, handling upserts, race conditions, and bulk insert deduplication.
How to fix Node.js UnhandledPromiseRejectionWarning and process crashes — why unhandled promise rejections crash Node.js 15+, how to add global handlers, find the source of the rejection, and fix async error handling.
How to fix Mongoose ValidationError when saving documents — required field errors, type cast failures, custom validator errors, and how to handle validation in Express APIs properly.
How to fix pnpm peer dependency errors — why pnpm is stricter than npm about peer deps, how to resolve missing peers, configure peerDependencyRules, and handle incompatible version ranges.
How to fix Socket.IO connection failures — CORS errors, transport fallback issues, wrong namespace, server not emitting to the right room, and how to debug Socket.IO connections in production.
How to fix Prisma migration errors — migrate dev failing with schema drift, migrate deploy errors in production, database out of sync, and how to safely reset or resolve migration conflicts.
How to fix Stripe webhook signature verification errors — why Stripe-Signature header validation fails, how to correctly pass the raw request body, and how to debug webhook delivery in the Stripe dashboard.
How to fix EMFILE too many open files errors on Linux and Node.js — caused by low ulimit file descriptor limits, file handle leaks, and how to increase limits permanently.
How to fix Nginx WebSocket proxying not working — 101 Switching Protocols fails, connections drop after 60 seconds, missing Upgrade headers, and SSL WebSocket configuration.
How to fix CORS errors in Express.js — cors middleware not applying, preflight OPTIONS requests failing, credentials not allowed, and specific origin whitelisting issues.
How to fix TypeScript path aliases not resolving — tsconfig paths configured but imports still fail at runtime, in Jest, or after building with webpack, Vite, or ts-node.
How to fix UnhandledPromiseRejectionWarning in Node.js and unhandled promise rejection errors in JavaScript caused by missing catch handlers, async/await mistakes, and event emitter errors.
How to fix Jest 'Exceeded timeout of 5000ms for a test' errors caused by unresolved promises, missing done callbacks, async/await mistakes, and slow database or network calls in tests.
How to fix the ECONNRESET and socket hang up errors in Node.js caused by server timeouts, keep-alive misconfiguration, proxy issues, large request bodies, SSL/TLS failures, and connection pool exhaustion.
How to fix 'SyntaxError: Cannot use import statement outside a module' in Node.js, TypeScript, Jest, and browsers by configuring ESM, package.json type, and transpiler settings.
How to fix Express.js Cannot GET route 404 error caused by wrong route paths, missing middleware, route order issues, static files, and router mounting problems.
How to fix the JavaScript heap out of memory error by increasing Node.js memory limits, fixing memory leaks, and optimizing builds in webpack, Vite, and Docker.
How to fix Node.js ERR_MODULE_NOT_FOUND when using ES modules, covering missing file extensions, directory imports, package.json exports, TypeScript paths, and ESM resolution differences.
How to fix the npm ENOENT no such file or directory error caused by missing package.json, wrong directory, corrupted node_modules, broken symlinks, and npm cache issues.
How to fix npm ENOTEMPTY directory not empty error caused by corrupted cache, concurrent npm operations, stale node_modules, and Windows file locking issues.
npm WARN deprecated [email protected], [email protected], [email protected], @humanwhocodes: which warnings are safe to ignore, which need fixing, and exact steps to silence each one.
How to fix the Node.js digital envelope routines unsupported error caused by OpenSSL 3.0 changes in Node.js 17+, with solutions for webpack, Vite, React, and Angular.
Resolve npm's cb() never called error by clearing cache, fixing network issues, updating npm, and resolving corrupted package-lock.json files.
How to fix .env files not being loaded by dotenv, Next.js, Vite, Django, or Docker Compose, including wrong file path, missing dotenv.config(), and variable naming issues.
How to fix the Yarn error 'integrity check failed' or 'Lockfile does not satisfy expected package' caused by corrupted cache, outdated lockfile, or version mismatches.
How to fix CORS errors when using cookies or Authorization headers, including 'Access-Control-Allow-Credentials' and wildcard origin conflicts.
How to fix npm audit vulnerabilities including high and critical severity issues, dependency conflicts, and when to use npm audit fix --force safely.
How to fix the Webpack error 'Module not found: Error: Can't resolve' caused by missing packages, wrong paths, aliases, or extension resolution issues.
How to fix the TypeScript error 'Cannot find module' or 'Could not find a declaration file for module' with proper type declarations and tsconfig settings.
How to fix the Redis ECONNREFUSED error when your application cannot connect to the Redis server on localhost:6379 or a remote host. Covers Redis not running, wrong host/port, Docker networking, firewall, AUTH required, maxclients, and TLS configuration.
How to fix EACCES permission denied errors in Node.js for mkdir, open, unlink, and scandir operations, covering npm global installs, Docker, NVM, CI/CD, and filesystem permissions.
How to fix the ENOSPC file watchers error on Linux by increasing the inotify watch limit, configuring VS Code, optimizing watched files, and handling Docker/WSL edge cases.
How to fix npm ERR! code ELIFECYCLE, npm ERR! errno 1, and npm ERR! Failed at the script errors. Covers reading the real error, node_modules corruption, node-gyp failures, wrong Node version, memory issues, postinstall failures, Windows-specific fixes, and more.
How to fix MongoDB 'MongoServerError: bad auth Authentication failed', 'MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017', and 'MongooseServerSelectionError' connection errors. Covers MongoDB not running, connection string format, Atlas network access, Docker networking, authentication, DNS/SRV issues, TLS/SSL, and Mongoose options.
How to fix 'Process completed with exit code 1' and other GitHub Actions workflow failures. Covers reading logs, exit codes, Node.js/Python/Docker step failures, secrets and environment variables, GITHUB_TOKEN permissions, checkout issues, caching, timeouts, self-hosted runners, matrix strategy, and artifacts.
How to fix 'SSL certificate problem: unable to get local issuer certificate', 'CERT_HAS_EXPIRED', 'ERR_CERT_AUTHORITY_INVALID', and 'self signed certificate in certificate chain' errors in Git, curl, Node.js, Python, Docker, and more. Covers CA certificates, corporate proxies, Let's Encrypt, certificate chains, and self-signed certs.
How to fix 'ERR_CONNECTION_REFUSED', 'localhost refused to connect', and 'This site can't be reached' errors when accessing localhost in Chrome, Firefox, and Edge. Covers dev servers, port issues, 0.0.0.0 vs 127.0.0.1, Docker port mapping, WSL2, firewalls, and more.
How to fix "npm ERR! Missing script" for start, dev, build, and test. Covers adding scripts to package.json, common framework configurations for React, Next.js, Vite, Angular, Express, and Nest.js.
How to fix 'process.env.VARIABLE_NAME is undefined' and environment variables not loading from .env files in Node.js, React, Next.js, Vite, and Docker.
How to fix 'port 3000 is already in use', 'EADDRINUSE', and 'address already in use :::3000' errors in Node.js, React, Next.js, and other frameworks on macOS, Linux, and Windows.
How to fix the ERESOLVE unable to resolve dependency tree error in npm. Covers root causes, peer dependency conflicts, --legacy-peer-deps, --force, npm overrides, and edge cases with React 18, TypeScript, and monorepos.
How to fix 'Error: EACCES: permission denied, access /usr/local/lib/node_modules' when running npm install -g on macOS or Linux. Multiple solutions ranked by recommendation.
How to fix 'Error: Cannot find module' and 'MODULE_NOT_FOUND' in Node.js. Covers missing packages, wrong import paths, node_modules issues, TypeScript moduleResolution, ESM vs CJS, and monorepo hoisting.
How to fix 'Access to fetch at ... from origin ... has been blocked by CORS policy: No Access-Control-Allow-Origin header is present on the requested resource' in JavaScript. Covers Express, Django, Flask, Spring Boot, ASP.NET, nginx, Apache, dev proxies, preflight requests, credentials, and edge cases.