📌  相关文章
📜  fs.readFile ENOENT:没有这样的文件或目录 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:11.748000             🧑  作者: Mango

代码示例1
If passing a relative filepath to readFile(),
fs.readFile() reads file paths RELATIVE TO THE CURRENT WORKING DIRECTORY

It is better to create a filepath using the following:
path.join(__dirname, "path", "to", "file", "from", "current", "working", "directory")

Need to import the path from "path" => const path = require("path")