使用Node.js,我得到“错误:EISDIR,已读". [英] Using Node.js I get, "Error: EISDIR, read"

查看:91
本文介绍了使用Node.js,我得到“错误:EISDIR,已读".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试打开一个文件时,

When ever I try to open a file I get,

events.js:72
        throw er; // Unhandled 'error' event
Error: EISDIR, read

推荐答案

此错误很简单,

cd /tmp
mkdir dir
node -e "var fs = require('fs'); fs.createReadStream( 'dir' );"

EISDIR 表示该操作的目标实际上是目录,但是目标的预期文件类型是目录以外的其他东西.

EISDIR means that the target of the operation is a directory in reality but that the expected filetype of the target is something other than a directory.

这篇关于使用Node.js,我得到“错误:EISDIR,已读".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆