error TS1259: Module '"stream"' can only be default-imported using the 'esModuleInterop' flag

Uncategorized
39 words

の解決方法

「tsconfig.json」に次の項目を追加する。

  • esModuleInterop: true
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017",
"esModuleInterop": true,
},
"compileOnSave": true,
"include": [
"src"
]
}