In an .mjs file, you do not use require. You use import. Try:
import fs from "fs";
More info:
https://nodejs.org/api/esm.html
-John
On Sun, Jun 7, 2020, 9:33 AM Matthew Hamilton wrote:
> node.js 14.4.0 macOS Catalina, Visual Studio Code debugging. Line 11 in my
> app.mjs file is var FileSys
node.js 14.4.0 macOS Catalina, Visual Studio Code debugging. Line 11 in my
app.mjs file is var FileSystem = require('fs'); The debugger throws
"require is not defined" error on this line. Comment this line out and the
debugger throws an error on line 23 which is var PDFImage =
require('pdf-imag