An error has occurred: TypeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Received type function ([Function (anonymous)])