Directory path not defined error in Node - ReferenceError

82 Views Asked by At

Trying to get the directory path of my current script in NodeJs using "__dirname". I'm getting Reference Error. What can be wrong

Here's the code (though it's part of a larger code base):

import path from 'path'

console.log(__dirname)

Error Image

0

There are 0 best solutions below