fs.writeFile 写入失败:Error: ENOENT: no such file or directory
node.js异常信息提示:
fs.writeFile 写入失败:Error: ENOENT: no such file or directory, open 'd:\uni_app\nodejs\20211229\html01\cap\02.html'
原因分析
1、fs.writeFile()方法只能用来创建文件,不能用来创建路径。
2、重复调用fs.writeFile()方法写入同一个文件,新写入的内容会覆盖原来的内容。

浙公网安备 33010602011771号