Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 读取带有节点js的文件时出错_Node.js_File_Compiler Errors_Readfile - Fatal编程技术网

Node.js 读取带有节点js的文件时出错

Node.js 读取带有节点js的文件时出错,node.js,file,compiler-errors,readfile,Node.js,File,Compiler Errors,Readfile,我无法读取在internet上找到的带有此代码的文件 var express=require('express'); var-app=express(); var fs=需要('fs'); var端口=8080; app.get('/',函数(req,res){ fs.readFile('./querys/anagconti\u clienti\u giorni.txt',utf8',函数(err,data){ 如果(错误){ res.send(err); }否则{ res.send(数据);

我无法读取在internet上找到的带有此代码的文件

var express=require('express');
var-app=express();
var fs=需要('fs');
var端口=8080;
app.get('/',函数(req,res){
fs.readFile('./querys/anagconti\u clienti\u giorni.txt',utf8',函数(err,data){
如果(错误){
res.send(err);
}否则{
res.send(数据);
}
});
});
var server=app.listen(端口,函数(){
console.log(“启动于http://localhost:“+港口);
});
它给我的错误是:

{
“错误号”:-4058,
“代码”:“enoint”,
“系统调用”:“打开”,
“路径”:“C:\Users\AlessandroGolin\Desktop\Mia\Visual\u Studio\server\u link\querys\anagconti\u clienti\u giorni.txt
“}


导致此错误的原因是什么?

请交叉检查“/querys/anagconti\u clienti\u giorni.txt”文件的路径或权限。如果文件不存在,则在上述代码文件所在的同一级别创建“查询”文件夹。

好的,谢谢您的建议:)事实上,我意识到插入的目录是错误的!