i have used var module = require('/path/to/node_modules/module-name')
and all of my other models get recognized but fs
does not get recognized even though I've pointed to where it is and made sure that its installed?? i do not understand, please help
my console gives out this:
but all my other modules are fine
as you can see by my referencing:
i have used var module = require('/path/to/node_modules/module-name')
and all of my other models get recognized but fs
does not get recognized even though I've pointed to where it is and made sure that its installed?? i do not understand, please help
my console gives out this: http://prntscr./g2akvs
but all my other modules are fine
as you can see by my referencing: http://prntscr./g2akzm
fs
is a native nodejs module, it sould be imported as is: let fs = require('fs');
– alexmac
Commented
Jul 30, 2017 at 23:04
In node.js, fs
is a native, built-in module. You include it without any path as in:
const fs = require('fs');
Here's the list of built-in libs from the 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'
];