TypeScript error TS5023: Unknown compiler option 'strict'
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...
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"
}
I had this same error.
What fixed for me was uninstalling the global tslint
and making sure that I have the latest from tslint
, tsc
, and typescript
installed. (Looks like not all combinations work.)
After installing these locally and removing all global packages, I have received finally my compilation errors.