我需要将文件写入以下路径:
fs.writeFile('/folder1/folder2/file.txt', 'content', function () {…});
但'/folder1/folder2'路径可能不存在。因此,我得到以下错误:
'/folder1/folder2'
message=ENOENT,打开/folder1/folder2/file.txt
如何将内容写入该路径?
https://stackoverflow.com/questions/16316330
相似问题