"module fs cannot be found"

"module fs cannot be found"

我已经使用了 var module = require('/path/to/node_modules/module-name') 并且我的所有其他模型都得到了识别,但是 fs 没有得到识别,即使我已经指出它的位置并确保它已安装?不懂,求助

我的控制台给出了这个: http://prntscr.com/g2akvs

但我所有的其他模块都很好

正如您通过我的参考所看到的: http://prntscr.com/g2akzm

在node.js中,fs是一个原生的内置模块。您在没有任何路径的情况下包含它,如:

const fs = require('fs');

这是来自 node.js source 的内置库列表:

const builtinLibs = [
  'assert', 'async_hooks', 'buffer', 'child_process', 'cluster', 'crypto',
  'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net', 'os',
  'path', 'punycode', 'querystring', 'readline', 'repl', 'stream',
  'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'
];