fs.mkdir not creating directory nor giving error

657 Views Asked by At

The following code does not create a new directory, nor does it output any err

const fs = require("fs-extra");

fs.mkdir(dirPath, { recursive: true }, (err) => {
  if (err) {
    console.log("ERR: When attempting to mkdir", err);
  } else {
    console.log("MKDIR made " + dirPath);
  }
  cb(null, dirPath);
});

I would expect the directory to be created... or an error.

When I console.log(err) I find that the value of err is null.

How can I ensure this directory has been created?

0

There are 0 best solutions below