З посібника з вузла я бачу, що я можу отримати каталог файлу з __dirname, але з REPL це здається невизначеним. Це непорозуміння з мого боку чи де помилка?
$ node
> console.log(__dirname)
ReferenceError: __dirname is not defined
at repl:1:14
at REPLServer.eval (repl.js:80:21)
at Interface.<anonymous> (repl.js:182:12)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
at Interface._line (readline.js:426:8)
at Interface._ttyWrite (readline.js:603:14)
at ReadStream.<anonymous> (readline.js:82:12)
at ReadStream.emit (events.js:88:20)
at ReadStream._emitKey (tty.js:320:10)
"browser": trueзамість "node": trueсвого файлу .eslintrc.json.
__dirnameа__filenameтакож недоступні, колиnodeвикликається--experimental-modulesпрапором .