10

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"                      
  }
}
3
  • Whats in your tsconfig.json? Commented Mar 12, 2018 at 14:19
  • updated question Commented Mar 13, 2018 at 11:24
  • 1
    Doing tsc on the command line would probably just give you the globally installed version. Is your local typescript version updated? Commented Mar 13, 2018 at 11:29

3 Answers 3

8

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

Sign up to request clarification or add additional context in comments.

3 Comments

What do you mean by call local version of TypeScript. Do you have an example?
You mean you weren't using the local version of Typescript in the project... ?
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.
3

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

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.