typescript Error: Cannot find name ‘__dirname‘
Solution:
Add “node” to the tsconfig.json file compilerOptions.types
{
"compilerOptions": {
...
"types": [
"node"
]
...
}
}
Install @types/node
npm install @types/node --save-dev
Read More:
- Ts-node Error: return new TSError(diagnosticText, diagnosticCodes);
- How to Solve Vite package error
- [Solved] error TS1086: An accessor cannot be declared in an ambient context
- Using ts-node to Execute .ts files Error [Solved]
- Typescript error: TSError: x Unable to compile TypeScript…
- npm ERR code ELIFECYCLE [How to Solve]
- Method of identifying vite alias path by idea webstorm
- [Solved] Syntax Error: Error: No ESLint configuration found & TypeError: eslint.CLIEngine is not a constructor
- Error: Cannot find module ‘./application‘ [How to Solve]
- [Solved] Syntax Error: Error: Node Sass does not yet support your current environment: OS X Unsupported archi
- [Solved] Syntax Error: Error: Node Sass does not yet support your current environment:
- [Solved] gyp ERR! stack Error: Could not find any Python installation to use
- [Solved] npm Install vuex Error: npm ERR! code ERESOLVE
- [Solved] Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
- [Solved] VS Code Error: Vetur can‘t find ‘tsconfig.json‘ or ‘jsconfig.json‘
- Vue3 + vite install element-plus error [How to Solve]
- Vue-cli2 sub environment packaging
- [Solved] Syntax Error: Error: Cannot find module ‘cache-loader‘
- Vue Use scss Error: this.getOptions is not a function [How to Solve]
- Vue project Run Error: Syntax Error: Error: Cannot find module ‘less‘