It happens when we try to use __dirname
in a TS file.
Steps to fix this:
Installing node types: npm i -D @types/node
Applying types in to tsconfig.json:
"compilerOptions": {
"types": ["node"],
},
Then using it:
import * as path from 'path'
console.log(__dirname)
Top comments (0)