In my typescript code I am trying to access the __dirname global object: https://nodejs.org/docs/latest/api/globals.html
__dirname
I am seeing a compile error:
In tsconfig.json add "node" to compilerOptions.types.
tsconfig.json
"node"
compilerOptions.types
Example:
{ "compilerOptions": { ... "types": [ "node" ] ... } }
Then run npm install @types/node --save-dev
npm install @types/node --save-dev