使用 Node.js 我得到,“错误:EISDIR,读取”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20417118/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using Node.js I get, "Error: EISDIR, read"
提问by Evan Carroll
When ever I try to open a file I get,
每当我尝试打开文件时,
events.js:72
throw er; // Unhandled 'error' event
Error: EISDIR, read
回答by Evan Carroll
This error is simple,
这个错误很简单,
cd /tmp
mkdir dir
node -e "var fs = require('fs'); fs.createReadStream( 'dir' );"
EISDIRmeans that the target of the operation is a directory in reality but that the expected filetype of the target is something otherthan a directory.
EISDIR意味着操作的目标是在现实中的目录,但该目标的预期文件类型是什么其他的不是目录。
回答by Mohan Dere
回答by Christof
Just came across this error and in my case it was due having used bower linkpreviously to link to local sources which then creates a symlink in the directory.
Once I've bower unlinked all the components, it worked again as expected.
刚刚遇到此错误,在我的情况下,这是由于bower link以前用于链接到本地源,然后在目录中创建符号链接。一旦我bower unlink编辑了所有组件,它就会再次按预期工作。
Hope this might help someone.
希望这可以帮助某人。

