Fs in settings.js

I am following along with a "How to.." book for a project and it is instructing me to uncomment the following line:
// var fs = require("fs");

I am unable to locate this line in the file. Is this an older reference that has been supplemented by something else, am I just not seeing it, or some other option?

Thanks for any guidance.

The most recent default settings file no longer has that line in it.

In what context is it telling you to do that? There would be no harm adding the line:

var fs = require("fs");

to the very top of the settings file, but it may not still be necessary.

Here's the reason given in the text:
Enabling the fs module is required because we want to enable HTTPS on our Node-RED instance.

If you find the https section in the settings file, which I assume the book also tells you to uncomment, you'll see we have "inlined" the require statements:

    //https: {
    //  key: require("fs").readFileSync('privkey.pem'),
    //  cert: require("fs").readFileSync('cert.pem')
    //},

We did this to remove confusion over having to uncomment lines in multiple places in the file - better to keep it all in one place.

Yes it (the book) does. I thought that might have been the case but didn't want to just go on an assumption.
Thanks for the clarification!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.