I've found this answer, but it didn't solve my problem.
I'm just learning TypeScript.
What I'm doing is as simple as this:
import * as child from 'child_process';
Which triggers this error:
TSError: ⨯ Unable to compile TypeScript
db\installDB.ts (1,24): Cannot find module 'child_process'. (2307)
What I thought is: It's not finding 'child_process' because I have no typings for it, so I added @types/node
on the hope it would now find it. It didn't.
What is the problem?
This is my tsconfig.json
:
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"allowJs": true
},
"include": [
"./db/**/*",
"./src/**/*"
]
}