你正在寻找的函数是fs.renameSync(old_file_path, new_file_path) 你可以在节点文档这里找到它。记得你还需要使用const fs = require('fs')来引入文件系统。