TypeError:fs.​​writeFileSyns不是函数

时间:2019-08-20 15:18:43

标签: node.js

TypeError:fs.​​writeFileSyns不是函数

var fs = require("fs");

var newFile = fs.readFileSync("readMe.txt", "utf8");
fs.writeFileSyns("writeMe.txt", newFile);

1 个答案:

答案 0 :(得分:1)

您的代码中有一个错字,应该是fs.writeFileSync("writeMe.txt", newFile);

var fs = require("fs");

var newFile = fs.readFileSync("readMe.txt", "utf8");
fs.writeFileSync("writeMe.txt", newFile);