Node.js error codes
27 codes — tap one for its meaning, causes, and fix steps.
- ERR_BUFFER_OUT_OF_BOUNDSAn offset or length value provided to a Buffer method falls outside the buffer's boundaries
- ERR_DLOPEN_FAILEDNode.js failed to load a native addon (.node file) using dlopen/LoadLibrary
- ERR_FS_FILE_TOO_LARGEThe file is larger than the maximum size that can be read into memory by fs.readFile
- ERR_HTTP_HEADERS_SENTAn attempt was made to set or send HTTP response headers after the response has already been sent
- ERR_INTERNAL_ASSERTIONAn internal Node.js assertion failed — this indicates a bug in Node.js itself
- ERR_INVALID_ARG_TYPEA function was called with an argument of the wrong type
- ERR_INVALID_ARG_VALUEA function argument has a valid type but an invalid or out-of-range value
- ERR_INVALID_FILE_URL_PATHA file: URL has a path that is invalid on the current operating system
- ERR_INVALID_MODULE_SPECIFIERThe module specifier string passed to import() or require() is not a valid module identifier
- ERR_INVALID_PACKAGE_CONFIGThe package.json file for a module is malformed and cannot be parsed
- ERR_INVALID_PACKAGE_TARGETThe target in the package.json exports or imports map is invalid
- ERR_INVALID_RETURN_VALUEA hook or callback returned a value of the wrong type
- ERR_INVALID_URLA string could not be parsed as a valid URL by the WHATWG URL API
- ERR_MISSING_ARGSA required argument was omitted from a Node.js API call
- ERR_MODULE_NOT_FOUNDNode.js cannot locate the module specified in an import or require statement
- ERR_OUT_OF_RANGEA numeric argument is outside the permissible range for that API
- ERR_PACKAGE_PATH_NOT_EXPORTEDThe package.json exports field does not expose the requested sub-path
- ERR_REQUIRE_CYCLE_MODULEA circular require dependency was detected while loading modules in CJS
- ERR_REQUIRE_ESMA CommonJS require() call attempted to load an ES module
- ERR_SOCKET_BAD_PORTA network socket operation specified a port number that is outside the valid range of 0 to 65535
- ERR_STREAM_DESTROYEDAn operation was performed on a stream that has already been destroyed
- ERR_STREAM_WRITE_AFTER_ENDData was written to a writable stream after it had been ended
- ERR_TLS_CERT_ALTNAME_INVALIDThe hostname does not match any Subject Alternative Name in the TLS certificate presented by the server
- ERR_UNESCAPED_CHARACTERSA URL or path string contains characters that must be percent-encoded but were passed unescaped
- ERR_UNHANDLED_REJECTIONA Promise was rejected but no rejection handler was attached
- ERR_UNKNOWN_FILE_EXTENSIONNode.js does not recognize the file extension when loading a module
- ERR_UNSUPPORTED_DIR_IMPORTA directory was imported directly but Node.js does not support directory imports in ESM