NODE_REDIRECT_WARNINGS=file


设置后,进程警告将输出到指定文件,而不是打印到标准错误。若文件不存在,将会创建该文件;若文件已存在,则会追加内容。如果在尝试将警告写入文件时发生错误,警告将改为写入标准错误。这相当于使用 --redirect-warnings=file 命令行选项。

【When set, process warnings will be emitted to the given file instead of printing to stderr. The file will be created if it does not exist, and will be appended to if it does. If an error occurs while attempting to write the warning to the file, the warning will be written to stderr instead. This is equivalent to using the --redirect-warnings=file command-line flag.】