Node.JS readFileSync() function

后端 未结 1 660
渐次进展
渐次进展 2020-12-16 00:32

index.js

var server = require(\"./server\");
var router = require(\"./router\");

server.start(router.route);

server.js

//S         


        
相关标签:
1条回答
  • 2020-12-16 00:51

    EISDIR error occurs when you try to open a file, but the path given is a directory. See related question and answer: Using Node.js I get, "Error: EISDIR, read".

    To debug this I would log to console the variable directpath and I would assume that it is pointing to a directory, not a file. Correctly setting this variable to the intended path should solve your problem.

    0 讨论(0)
提交回复
热议问题