Common Node.js Errors
Node.js errors including module resolution, async/await pitfalls, Express middleware, and memory issues.
100 errors documented with step-by-step fixes
Cannot read properties of undefined Node.js
TypeError: Cannot read properties of undefinedYou accessed a property on undefined, usually from uninitialized data.
Is not a function Node.js
TypeError: x is not a functionYou tried to call something that isn't a function.
Is not defined Node.js
ReferenceError: x is not definedA variable was used before declaration or isn't in scope.
Cannot find module Node.js
Error: Cannot find moduleNode can't find the module you're trying to require/import.
Cannot require ES module Node.js
ERR_REQUIRE_ESMYou used require() on a package that only supports ES modules.
Cannot use import outside module Node.js
SyntaxError: Cannot use import statementYou used import syntax without ESM support.
Unhandled promise rejection Node.js
UnhandledPromiseRejectionA promise rejected but there was no .catch() handler.
Port already in use EADDRINUSE Node.js
Error: listen EADDRINUSEAnother process is already using the port.
ENOENT file not found Node.js
Error: ENOENT no such fileThe file or directory doesn't exist.
EACCES permission denied Node.js
Error: EACCES permission deniedNode doesn't have permission to access the file or port.
ECONNREFUSED connection refused Node.js
Error: ECONNREFUSEDThe server you're connecting to isn't running.
ETIMEDOUT connection timeout Node.js
Error: ETIMEDOUTThe connection timed out.
Maximum call stack Node.js
RangeError: Maximum call stack size exceededInfinite recursion or too-deep recursion.
Heap out of memory Node.js
FATAL ERROR: heap out of memoryThe Node.js process ran out of memory.
MongoDB connection refused Node.js
Error: connect ECONNREFUSED 127.0.0.1:27017MongoDB isn't running or the connection string is wrong.
Too many open files EMFILE Node.js
Error: EMFILE too many open filesThe process has too many file descriptors open.
MongoDB duplicate key error Node.js
MongoServerError: E11000 duplicate keyYou tried to insert a document with a duplicate unique field.
Request body undefined Express Node.js
Error: req.body is undefined ExpressExpress middleware for parsing request bodies isn't configured.
Cannot GET route Express Node.js
Error: Cannot GET /path ExpressNo route handler matches the requested URL.
Next called after response Express Node.js
Error: next() called after responseA middleware called next() after the response was already sent.
TypeAssignment to constant variable in Node.js
TypeError: Assignment to constant variableThis Node.js error occurs when assignment to constant variable. Check the stack trace for the exact location and fix the root cause.
TypeConverting circular structure to JSON in Node.js
TypeError: Converting circular structure to JSONThis Node.js error occurs when converting circular structure to json. Check the stack trace for the exact location and fix the root cause.
TypeCannot destructure property of undefined in Node.js
TypeError: Cannot destructure property of undefinedThis Node.js error occurs when cannot destructure property of undefined. Check the stack trace for the exact location and fix the root cause.
Typepath must be a string or Buffer in Node.js
TypeError: path must be a string or BufferThis Node.js error occurs when path must be a string or buffer. Check the stack trace for the exact location and fix the root cause.
Typecallback must be a function in Node.js
TypeError: callback must be a functionThis Node.js error occurs when callback must be a function. Check the stack trace for the exact location and fix the root cause.
Typefirst argument must be a string or Buffer in Node.js
TypeError: first argument must be a string or BufferThis Node.js error occurs when first argument must be a string or buffer. Check the stack trace for the exact location and fix the root cause.
TypeCannot set headers after they are sent in Node.js
TypeError: Cannot set headers after they are sentThis Node.js error occurs when cannot set headers after they are sent. Check the stack trace for the exact location and fix the root cause.
SyntaxUnexpected end of JSON input in Node.js
SyntaxError: Unexpected end of JSON inputThis Node.js error occurs when unexpected end of json input. Check the stack trace for the exact location and fix the root cause.
SyntaxUnexpected token in JSON at position in Node.js
SyntaxError: Unexpected token in JSON at positionThis Node.js error occurs when unexpected token in json at position. Check the stack trace for the exact location and fix the root cause.
RangeMaximum call stack size exceeded in Node.js
RangeError: Maximum call stack size exceededThis Node.js error occurs when maximum call stack size exceeded. Check the stack trace for the exact location and fix the root cause.
RangeInvalid array buffer length in Node.js
RangeError: Invalid array buffer lengthThis Node.js error occurs when invalid array buffer length. Check the stack trace for the exact location and fix the root cause.
ERR_HTTP_HEADERS_SENT in Node.js
Error: ERR_HTTP_HEADERS_SENTThis Node.js error occurs when err_http_headers_sent. Check the stack trace for the exact location and fix the root cause.
ENOMEM not enough memory in Node.js
Error: ENOMEM not enough memoryThis Node.js error occurs when enomem not enough memory. Check the stack trace for the exact location and fix the root cause.
EPERM operation not permitted in Node.js
Error: EPERM operation not permittedThis Node.js error occurs when eperm operation not permitted. Check the stack trace for the exact location and fix the root cause.
EISDIR illegal operation on a directory in Node.js
Error: EISDIR illegal operation on a directoryThis Node.js error occurs when eisdir illegal operation on a directory. Check the stack trace for the exact location and fix the root cause.
ENOTDIR not a directory in Node.js
Error: ENOTDIR not a directoryThis Node.js error occurs when enotdir not a directory. Check the stack trace for the exact location and fix the root cause.
ENOTEMPTY directory not empty in Node.js
Error: ENOTEMPTY directory not emptyThis Node.js error occurs when enotempty directory not empty. Check the stack trace for the exact location and fix the root cause.
EEXIST file already exists in Node.js
Error: EEXIST file already existsThis Node.js error occurs when eexist file already exists. Check the stack trace for the exact location and fix the root cause.
ERR_INVALID_ARG_TYPE in Node.js
Error: ERR_INVALID_ARG_TYPEThis Node.js error occurs when err_invalid_arg_type. Check the stack trace for the exact location and fix the root cause.
ERR_STREAM_WRITE_AFTER_END in Node.js
Error: ERR_STREAM_WRITE_AFTER_ENDThis Node.js error occurs when err_stream_write_after_end. Check the stack trace for the exact location and fix the root cause.
ERR_SOCKET_BAD_PORT in Node.js
Error: ERR_SOCKET_BAD_PORTThis Node.js error occurs when err_socket_bad_port. Check the stack trace for the exact location and fix the root cause.
ERR_OUT_OF_RANGE in Node.js
Error: ERR_OUT_OF_RANGEThis Node.js error occurs when err_out_of_range. Check the stack trace for the exact location and fix the root cause.
ERR_AMBIGUOUS_ARGUMENT in Node.js
Error: ERR_AMBIGUOUS_ARGUMENTThis Node.js error occurs when err_ambiguous_argument. Check the stack trace for the exact location and fix the root cause.
ERR_INVALID_URL in Node.js
Error: ERR_INVALID_URLThis Node.js error occurs when err_invalid_url. Check the stack trace for the exact location and fix the root cause.
ERR_HTTP2_STREAM_ERROR in Node.js
Error: ERR_HTTP2_STREAM_ERRORThis Node.js error occurs when err_http2_stream_error. Check the stack trace for the exact location and fix the root cause.
DEPTH_ZERO_SELF_SIGNED_CERT in Node.js
Error: DEPTH_ZERO_SELF_SIGNED_CERTThis Node.js error occurs when depth_zero_self_signed_cert. Check the stack trace for the exact location and fix the root cause.
UNABLE_TO_VERIFY_LEAF_SIGNATURE in Node.js
Error: UNABLE_TO_VERIFY_LEAF_SIGNATUREThis Node.js error occurs when unable_to_verify_leaf_signature. Check the stack trace for the exact location and fix the root cause.
certificate has expired in Node.js
Error: certificate has expiredThis Node.js error occurs when certificate has expired. Check the stack trace for the exact location and fix the root cause.
self signed certificate in certificate chain in Node.js
Error: self signed certificate in certificate chainThis Node.js error occurs when self signed certificate in certificate chain. Check the stack trace for the exact location and fix the root cause.
EHOSTUNREACH in Node.js
Error: EHOSTUNREACHThis Node.js error occurs when ehostunreach. Check the stack trace for the exact location and fix the root cause.
ENETUNREACH in Node.js
Error: ENETUNREACHThis Node.js error occurs when enetunreach. Check the stack trace for the exact location and fix the root cause.
read ECONNRESET in Node.js
Error: read ECONNRESETThis Node.js error occurs when read econnreset. Check the stack trace for the exact location and fix the root cause.
write EPIPE in Node.js
Error: write EPIPEThis Node.js error occurs when write epipe. Check the stack trace for the exact location and fix the root cause.
getaddrinfo ENOTFOUND in Node.js
Error: getaddrinfo ENOTFOUNDThis Node.js error occurs when getaddrinfo enotfound. Check the stack trace for the exact location and fix the root cause.
socket hang up in Node.js
Error: socket hang upThis Node.js error occurs when socket hang up. Check the stack trace for the exact location and fix the root cause.
connect ECONNREFUSED Redis in Node.js
Error: connect ECONNREFUSED RedisThis Node.js error occurs when connect econnrefused redis. Check the stack trace for the exact location and fix the root cause.
connect ECONNREFUSED PostgreSQL in Node.js
Error: connect ECONNREFUSED PostgreSQLThis Node.js error occurs when connect econnrefused postgresql. Check the stack trace for the exact location and fix the root cause.
connect ECONNREFUSED MySQL in Node.js
Error: connect ECONNREFUSED MySQLThis Node.js error occurs when connect econnrefused mysql. Check the stack trace for the exact location and fix the root cause.
MongooseOperation buffering timed out in Node.js
MongooseError: Operation buffering timed outThis Node.js error occurs when operation buffering timed out. Check the stack trace for the exact location and fix the root cause.
MongooseModel.findOne() no longer accepts callback in Node.js
MongooseError: Model.findOne() no longer accepts callbackThis Node.js error occurs when model.findone() no longer accepts callback. Check the stack trace for the exact location and fix the root cause.
SequelizeConnectionECONNREFUSED in Node.js
SequelizeConnectionError: ECONNREFUSEDThis Node.js error occurs when econnrefused. Check the stack trace for the exact location and fix the root cause.
SequelizeValidationError in Node.js
SequelizeValidationErrorThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
SequelizeUniqueConstraintError in Node.js
SequelizeUniqueConstraintErrorThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
PrismaClientKnownRequestError in Node.js
PrismaClientKnownRequestErrorThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
PrismaClientValidationError in Node.js
PrismaClientValidationErrorThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
Prisma migrate error: drift detected in Node.js
Prisma migrate error: drift detectedThis Node.js error occurs when drift detected. Check the stack trace for the exact location and fix the root cause.
Cannot find module 'node:test' in Node.js
Error: Cannot find module 'node:test'This Node.js error occurs when test'. Check the stack trace for the exact location and fix the root cause.
ERR_PACKAGE_PATH_NOT_EXPORTED in Node.js
Error: ERR_PACKAGE_PATH_NOT_EXPORTEDThis Node.js error occurs when err_package_path_not_exported. Check the stack trace for the exact location and fix the root cause.
ERR_MODULE_NOT_FOUND in Node.js
Error: ERR_MODULE_NOT_FOUNDThis Node.js error occurs when err_module_not_found. Check the stack trace for the exact location and fix the root cause.
ERR_UNKNOWN_FILE_EXTENSION in Node.js
Error: ERR_UNKNOWN_FILE_EXTENSIONThis Node.js error occurs when err_unknown_file_extension. Check the stack trace for the exact location and fix the root cause.
npm ERR! peer dep missing in Node.js
npm ERR! peer dep missingThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
npm ERR! ERESOLVE unable to resolve dependency tree in Node.js
npm ERR! ERESOLVE unable to resolve dependency treeThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
npm ERR! code ENOENT in Node.js
npm ERR! code ENOENTThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
npm ERR! code EACCES in Node.js
npm ERR! code EACCESThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
npm ERR! code ELIFECYCLE in Node.js
npm ERR! code ELIFECYCLEThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
yarn error: Integrity check failed in Node.js
yarn error: Integrity check failedThis Node.js error occurs when integrity check failed. Check the stack trace for the exact location and fix the root cause.
pnpm ERR! LOCKFILE_MISSING in Node.js
pnpm ERR! LOCKFILE_MISSINGThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
jest: Cannot find module from test in Node.js
jest: Cannot find module from testThis Node.js error occurs when cannot find module from test. Check the stack trace for the exact location and fix the root cause.
jest: SyntaxCannot use import statement outside a module in Node.js
jest: SyntaxError: Cannot use import statement outside a moduleThis Node.js error occurs when cannot use import statement outside a module. Check the stack trace for the exact location and fix the root cause.
vitest: Failed to resolve import in Node.js
vitest: Failed to resolve importThis Node.js error occurs when failed to resolve import. Check the stack trace for the exact location and fix the root cause.
webpack: Module not found in Node.js
webpack: Module not foundThis Node.js error occurs when module not found. Check the stack trace for the exact location and fix the root cause.
webpack: Module build failed in Node.js
webpack: Module build failedThis Node.js error occurs when module build failed. Check the stack trace for the exact location and fix the root cause.
esbuild: No loader is configured for in Node.js
esbuild: No loader is configured forThis Node.js error occurs when no loader is configured for. Check the stack trace for the exact location and fix the root cause.
vite: Failed to resolve entry for package in Node.js
vite: Failed to resolve entry for packageThis Node.js error occurs when failed to resolve entry for package. Check the stack trace for the exact location and fix the root cause.
vite: Pre-transform error in Node.js
vite: Pre-transform errorThis Node.js error occurs when pre-transform error. Check the stack trace for the exact location and fix the root cause.
Worker terminated due to reaching memory limit in Node.js
Error: Worker terminated due to reaching memory limitThis Node.js error occurs when worker terminated due to reaching memory limit. Check the stack trace for the exact location and fix the root cause.
kill ESRCH no such process in Node.js
Error: kill ESRCH no such processThis Node.js error occurs when kill esrch no such process. Check the stack trace for the exact location and fix the root cause.
spawn ENOENT in Node.js
Error: spawn ENOENTThis Node.js error occurs when spawn enoent. Check the stack trace for the exact location and fix the root cause.
SIGTERM received in Node.js
Error: SIGTERM receivedThis Node.js error occurs when sigterm received. Check the stack trace for the exact location and fix the root cause.
SIGKILL received in Node.js
Error: SIGKILL receivedThis Node.js error occurs when sigkill received. Check the stack trace for the exact location and fix the root cause.
cluster: worker died in Node.js
cluster: worker diedThis Node.js error occurs when worker died. Check the stack trace for the exact location and fix the root cause.
pm2: Process list empty in Node.js
pm2: Process list emptyThis Node.js error occurs when process list empty. Check the stack trace for the exact location and fix the root cause.
CORS origin not allowed in Node.js
Error: CORS origin not allowedThis Node.js error occurs when cors origin not allowed. Check the stack trace for the exact location and fix the root cause.
express-rate-limit: Too Many Requests in Node.js
express-rate-limit: Too Many RequestsThis Node.js error occurs when too many requests. Check the stack trace for the exact location and fix the root cause.
helmet CSP violation in Node.js
helmet CSP violationThis Node.js error occurs when an unexpected condition is encountered. Check the stack trace for the exact location and fix the root cause.
multer: Unexpected field in Node.js
multer: Unexpected fieldThis Node.js error occurs when unexpected field. Check the stack trace for the exact location and fix the root cause.
multer: File too large in Node.js
multer: File too largeThis Node.js error occurs when file too large. Check the stack trace for the exact location and fix the root cause.
body-parser: request entity too large in Node.js
body-parser: request entity too largeThis Node.js error occurs when request entity too large. Check the stack trace for the exact location and fix the root cause.
cookie-parser: Invalid cookie value in Node.js
cookie-parser: Invalid cookie valueThis Node.js error occurs when invalid cookie value. Check the stack trace for the exact location and fix the root cause.
express-session: secret option required in Node.js
express-session: secret option requiredThis Node.js error occurs when secret option required. Check the stack trace for the exact location and fix the root cause.
Bugsly catches Node.js errors automatically
AI-powered error tracking that explains what went wrong and suggests fixes. Set up in 2 minutes.
Get Started Free