2017-09-27 103 views
0

我试图使用readFilefs模块(节点版本5.3.0)。但我收到一个错误,说模块没有找到。我需要分别安装fs模块吗?如果确切的话要安装哪些软件包?它默认不可用?我是否需要在节点中安装fs模块

var freader = require('fs'); 
freader.readFile(... 
+2

'fs'这是一个原生的Node.js模块,你不需要它_install_。 – alexmac

+0

是的。 @alexmac这也是我的理解。这就是为什么我很厌烦。 –

回答

3

Here是文档约fs

使用FS作为尝试。

File I/O is provided by simple wrappers around standard POSIX functions. To use this module do require('fs'). All the methods have asynchronous and synchronous forms.


你没有npm包安装,它包含在node.js


编辑here is the documentation of fs for node v5.3和它的同

+1

是的,@Gregory。我知道它应该在那里默认。但问题仍然存在。让我尝试重新安装。 –

+0

你有什么确切的堆栈跟踪? –

+0

'TypeError:filesys.readFile is not a function' –

相关问题