[英]internal/modules/cjs/loader.js:883 throw err;
Here is the code:这是代码:
const fs= require("fs");
const text=fs.readFileSync("dele.txt","utf-8");
console.log(text);
Here is the error in terminal:这是终端中的错误:
Error: Cannot find module 'D:\programs\web development\tut64.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
In your script you are asking for fs
module.在您的脚本中,您要求
fs
模块。
Try to run npm install fs
in your console and be sure that you are running the command in your root folder.尝试在控制台中运行
npm install fs
并确保在根文件夹中运行该命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.