TypeScript error TS5023: Unknown compiler option 'strict'

typescript

Solution

You need the latest version.

Specifically, you need TypeScript@>=2.3

For project level installation (recommended)

npm install --dev typescript@latest

If you use `tsc` via the global command line

npm install --global typescript@latest

To override the version used by VS Code to use your global installation

Open user settings

Change it as follows (replace my name with yours)

 // Place your settings in this file to overwrite the default settings
 {
   "typescript.tsdk": "C:/Users/Aluan/AppData/Roaming/npm/node_modules/typescript/lib",
    //..

If you are running Linux or OSX the path will be something like

 "~/npm/node_modules/typescript/lib"

That said, the latest VS Code should ship with TypesScript@>3 so you shouldn't need to do anything except update it...

Naturally, this doesn't require npm. The following are examples using other package managers.

JSPM:

command line:

jspm install --dev typescript@latest

VS Code project level settings:

{
  "typescript.tsdk": "./jspm_packages/npm/typescript@latest/lib"
}

Yarn:

command line:

yarn add --dev typescript@latest

VS Code project level settings:

{
  "typescript.tsdk": "./node_modules/typescript/lib"
}

Problem

When using the option "strict" in `tsconfig.json` file, I get the error: ``` error TS5023: Unknown compiler option 'strict' ``` But this compiler option is clearly allowed in the official documentation: Reference: https://www.typescriptlang.org/docs/handbook/compiler-options.html And also my Visual Studio Code editor. Does anyone know what I did wrong? Here is my tsconfig.json file: ``` { "compilerOptions": { "strict": true, "sourceMap": true } } ```

Original source