2

i am using latest edgejs(6.5.1) in my node project. but when i use edge in my project,

var edge = require('edge');

i am getting this error

cannot resolve module 'fs'

later when i checked the edge.js file i see that edge is using 'fs'

var fs = require('fs'),
    path = require('path'),
    builtEdge = path.resolve(__dirname, '../build/Release/' + (process.env.EDGE_USE_CORECLR || !fs.existsSync(path.resolve(__dirname, '../build/Release/edge_nativeclr.node')) ? 'edge_coreclr.node' : 'edge_nativeclr.node')),
    edge;

How can i fix this error?

René Hoffmann
  • 2,766
  • 2
  • 20
  • 43
Roopak Puthenveettil
  • 1,387
  • 2
  • 13
  • 27
  • Try running `npm i -g fs` on the commandline and try running the project again. – cdaiga Apr 25 '17 at 08:39
  • 4
    Holy canole, no. If you're on node and `fs` can't be found, don't install it from npm. That is the _wrong_ solution, always. You have a serious misconfiguration if your node installation doesn't have `fs` since it comes standard. Try updating node to start, and show us the full error message. – Qix - MONICA WAS MISTREATED Apr 25 '17 at 09:33
  • Seconding what @Qix said - all you'll get if you install `fs` from NPM is a [placeholder package](https://www.npmjs.com/package/fs) (to prevent a malicious package from posing as a built-in Node module). – Joe Clay Apr 25 '17 at 09:55

0 Answers0