Errors/Node.js

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 undefined

You accessed a property on undefined, usually from uninitialized data.

Is not a function Node.js

TypeError: x is not a function

You tried to call something that isn't a function.

Is not defined Node.js

ReferenceError: x is not defined

A variable was used before declaration or isn't in scope.

Cannot find module Node.js

Error: Cannot find module

Node can't find the module you're trying to require/import.

Cannot require ES module Node.js

ERR_REQUIRE_ESM

You used require() on a package that only supports ES modules.

Cannot use import outside module Node.js

SyntaxError: Cannot use import statement

You used import syntax without ESM support.

Unhandled promise rejection Node.js

UnhandledPromiseRejection

A promise rejected but there was no .catch() handler.

Port already in use EADDRINUSE Node.js

Error: listen EADDRINUSE

Another process is already using the port.

ENOENT file not found Node.js

Error: ENOENT no such file

The file or directory doesn't exist.

EACCES permission denied Node.js

Error: EACCES permission denied

Node doesn't have permission to access the file or port.

ECONNREFUSED connection refused Node.js

Error: ECONNREFUSED

The server you're connecting to isn't running.

ETIMEDOUT connection timeout Node.js

Error: ETIMEDOUT

The connection timed out.

Maximum call stack Node.js

RangeError: Maximum call stack size exceeded

Infinite recursion or too-deep recursion.

Heap out of memory Node.js

FATAL ERROR: heap out of memory

The Node.js process ran out of memory.

MongoDB connection refused Node.js

Error: connect ECONNREFUSED 127.0.0.1:27017

MongoDB isn't running or the connection string is wrong.

Too many open files EMFILE Node.js

Error: EMFILE too many open files

The process has too many file descriptors open.

MongoDB duplicate key error Node.js

MongoServerError: E11000 duplicate key

You tried to insert a document with a duplicate unique field.

Request body undefined Express Node.js

Error: req.body is undefined Express

Express middleware for parsing request bodies isn't configured.

Cannot GET route Express Node.js

Error: Cannot GET /path Express

No route handler matches the requested URL.

Next called after response Express Node.js

Error: next() called after response

A middleware called next() after the response was already sent.

TypeAssignment to constant variable in Node.js

TypeError: Assignment to constant variable

This 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 JSON

This 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 undefined

This 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 Buffer

This 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 function

This 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 Buffer

This 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 sent

This 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 input

This 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 position

This 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 exceeded

This 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 length

This 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_SENT

This 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 memory

This 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 permitted

This 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 directory

This 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 directory

This 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 empty

This 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 exists

This 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_TYPE

This 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_END

This 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_PORT

This 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_RANGE

This 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_ARGUMENT

This 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_URL

This 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_ERROR

This 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_CERT

This 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_SIGNATURE

This 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 expired

This 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 chain

This 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: EHOSTUNREACH

This Node.js error occurs when ehostunreach. Check the stack trace for the exact location and fix the root cause.

ENETUNREACH in Node.js

Error: ENETUNREACH

This 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 ECONNRESET

This 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 EPIPE

This 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 ENOTFOUND

This 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 up

This 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 Redis

This 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 PostgreSQL

This 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 MySQL

This 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 out

This 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 callback

This 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: ECONNREFUSED

This Node.js error occurs when econnrefused. Check the stack trace for the exact location and fix the root cause.

SequelizeValidationError in Node.js

SequelizeValidationError

This 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

SequelizeUniqueConstraintError

This 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

PrismaClientKnownRequestError

This 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

PrismaClientValidationError

This 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 detected

This 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_EXPORTED

This 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_FOUND

This 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_EXTENSION

This 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 missing

This 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 tree

This 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 ENOENT

This 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 EACCES

This 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 ELIFECYCLE

This 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 failed

This 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_MISSING

This 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 test

This 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 module

This 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 import

This 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 found

This 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 failed

This 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 for

This 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 package

This 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 error

This 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 limit

This 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 process

This 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 ENOENT

This 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 received

This 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 received

This 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 died

This 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 empty

This 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 allowed

This 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 Requests

This 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 violation

This 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 field

This 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 large

This 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 large

This 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 value

This 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 required

This 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