Skip to content
RED SAG Skills
mediumStudy question · answer published in Node.js interview questions, so no pointsjavascriptmodulesnodejs

__dirname in an ES module

A Node.js script was converted to ESM ("type": "module"). It now fails with "__dirname is not defined". What is the modern fix?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions