Question

I'm really new to meteor and node.js and I think it's really awesome!

So the issue I am having is that I cannot access node's filesystem module from meteor. On stackoverflow, other users have reported that they use

var require = __meteor_bootstrap__.require;
var fs = require('fs');

However, when I call it, I get this error:

TypeError: undefined is not a function

I followed this this question's answer and I don't know what to do from here. I have made sure that the code above is located in the startup portion of the server.

Was it helpful?

Solution

As of Meteor 0.6.0, it would be:

var fs = Npm.require("fs");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top