Error code

Node.js ERR_INVALID_ARG_TYPE

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

What it means

A function was called with an argument of the wrong type.

How to fix it

  1. Check the function's documentation for the expected argument type.
  2. Add type validation before calling the API.
  3. Use TypeScript or JSDoc to catch type mismatches at development time.

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