Error code
Node.js ERR_BUFFER_OUT_OF_BOUNDS
NODE.JSERR_BUFFER_OUT_OF_BOUNDS
Runtime Error Code· An error code from a programming runtime or package manager, like Node.js or npm.
What it means
An offset or length value provided to a Buffer method falls outside the buffer's boundaries.
How to fix it
- Check the offset and length values before calling Buffer methods.
- Validate that offset + length does not exceed buffer.length.
- Use Buffer.slice or subarray with validated bounds.
Not affiliated with Node.js. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.
More Node.js codes
- 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