Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

ENOENT: no such file or directory的问题

$
0
0

我在linux上文件目录位置如下: /service/script/trackingList.txt /service/script/getTracking.js

getTracking.js读取trackingList.txt中的内容 getTracking.js中大致如下: var data = fs.readFileSync(‘trackingList.txt’,‘utf-8’); console.log(data);

通过node /service/script/getTracking.js执行提示错误“Error: ENOENT: no such file or directory, open ‘D:\cmder\config\profile.d\trackingList.txt’” 通过进入cd /service/script/ 然后node getTracking.js却可以输出结果

请问这是什么情况,如何解决?谢谢


Viewing all articles
Browse latest Browse all 14821

Trending Articles