TypeScript build error TS5023

10,254

Solution 1

I have found my mistake forget to call local version of TypeScript ./node_modules/.bin/tsc --init

Solution 2

npm install --save-dev [email protected] fixed it at my side.

Solution 3

What fixed for my was installing global the typescript via npm package manager:

npm install -g typescript

And then the tsc compiler was available:

e.g.: tsc -p src/server/ -w

Share:
10,254
Hattori Hanzō
Author by

Hattori Hanzō

Swift Lover, Rocket Ship Builder & Blockchain enthusiast. Coding for fun from 2003, for food 2006.

Updated on July 25, 2022

Comments

  • Hattori Hanzō
    Hattori Hanzō almost 2 years

    I am trying to compile TypeScript & NodeJS an getting this error any help?

    tsc --version => Version 2.7.2

    error TS5023: Unknown compiler option 'lib'.
    error TS5023: Unknown compiler option 'strict'.
    error TS5023: Unknown compiler option 'esModuleInterop'.
    The terminal process terminated with exit code: 1
    

    Updated, added tsconfig.json

    {
      "compilerOptions": {
        "target": "ES5",                          
        "module": "commonjs",                    
        "lib": ["es2015"],                            
    
        "sourceMap": true,                     
        "strict": true,                           
        "esModuleInterop": true, 
    
        "mapRoot": "./map"                      
      }
    }
    
  • Urasquirrel
    Urasquirrel almost 5 years
    What do you mean by call local version of TypeScript. Do you have an example?
  • Urasquirrel
    Urasquirrel almost 5 years
    You mean you weren't using the local version of Typescript in the project... ?
  • Urasquirrel
    Urasquirrel almost 5 years
    I had a similar issue where I was using ntsc npm package as a part of an example. Changing to use the correct tsc command fixed half my issues.