Node.js error - TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string

You should use Node >= v22.

You may refer to this topic, too: Error ERR_INVALID_ARG_TYPE while Generating [Resolved]