NicholasByDesign NicholasByDesign - 1 month ago 5x
Javascript Question

Write file from server returns success, but can not find file

I am trying to do a simple fs.writeFile on this server in meteor. It returns a success message for the majority of solutions I have tried. But I cannot find the file anywhere in the file structure. Ideas?

Here is a simple snippet I have tried.

const fs = require('fs');

var path = process.env['METEOR_SHELL_DIR'] + '/../../../public';

fs.writeFile('helloworld.txt', 'Hello World!', function (err) {
if (err) {
console.log("Error:" + err);
} else {


You're writing to 'helloworld.txt', but I think you meant to write to path+'/helloworld.txt'.