【发布时间】:2021-11-28 21:07:15
【问题描述】:
收到 undefined throw new ERR_INVALID_CALLBACK(cb);
const fs = require("fs");
const text = "File ";
fs.writeFile("node-message.txt", text)
.then(() => {
console.log("File Created");
})
.catch(() => {
console.log("File not created");
});
我收到这个 TypeError [ERR_INVALID_CALLBACK]: Callback must be a function。
【问题讨论】: