TS5070

error TS5070: Option ‘–resolveJsonModule’ cannot be specified without ‘node’ module resolution strategy.

Broken Code ❌

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"compilerOptions": {
"jsx": "preserve",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"module": "esnext",
"resolveJsonModule": true,
"target": "es6"
}
}

Fixed Code ✔️

Just define the “moduleResolution” property and set it to “node”:

tsconfig.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"compilerOptions": {
"jsx": "preserve",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"target": "es6"
}
}