How To Fix ReferenceError: __dirname is not defined
I recently tried to use __dirname inside a ES module. It turns out, that I cannot. It throws an error. So let us see how To Fix ReferenceError: __dirname is not defined. For people who do not know what it is, let us first discuss what __dirname is. __dirname is a global variable in Node.js...