I cannot figure out how to make my 'tsc' command working:
tsc
module.js:472
throw err;
^
Error: Cannot find module 'typescript/tsc.js'
at Function.Module._resolveFilename (module.js:470:15)
My 'package.json' has:
"devDependencies": {
"@types/node": "^14.11.2",
"tslib": "^2.0.1",
"typedoc": "^0.19.2",
"typescript": "^4.0.3"
}
And my 'tsconfig.json':
{
"compilerOptions": {
"target": "es6",
"sourceMap": true,
"declaration": true,
"declarationDir": "dist/types",
"strict": true,
"noUnusedLocals": true,
"lib": [
"es2019"
]
},
"include": [
"src"
]
}
No error during 'npm install'.
When I check up the 'node_modules' folder, typescript exists and the 'tsc.js' file exists within the 'typescript/lib' directory.
node --version: 12.18.4
npm --version: 6.14.6
system: Ubuntu 16.04 LTS
I have tried many of the solution proposed for a similar issue without success:
- delete the node_modules folder and then run npm install again
- try to reinstall manually: npm install typescript --save-dev
- using: npm install typescript-tools --save-dev
- ...
None of the above gets me any result. Thank you very much for your help.