Error code

Node.js ERR_FS_FILE_TOO_LARGE

NODE.JSERR_FS_FILE_TOO_LARGE
Runtime Error Code· An error code from a programming runtime or package manager, like Node.js or npm.

What it means

The file is larger than the maximum size that can be read into memory by fs.readFile.

How to fix it

  1. Use streaming APIs (fs.createReadStream) instead of fs.readFile for large files.
  2. Process the file in chunks.
  3. Increase the Node.js heap with --max-old-space-size if reading many files.

Not affiliated with Node.js. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.