Unknown compiler option 'lib' when running demo.
taji opened this issue · comments
taji:~/workspace (master) $ npm install -g ts-node
taji:~/workspace (master) $ npm install
taji:~/workspace (master) $ ts-node demo/index.ts
/home/ubuntu/.nvm/versions/node/v7.4.0/lib/node_modules/ts-node/src/index.ts:199
throw new TSError(formatDiagnostics(configDiagnostics, cwd, ts, 0))
^
TSError: ⨯ Unable to compile TypeScript
Unknown compiler option 'lib'. (5023)
I'm running :
ts-node v2.0.0
node v7.4.0
Looking at the tsconfig.json file:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"experimentalDecorators": true,
"outDir": "./dist",
"lib": ["es2015", "dom"]
},
"exclude": [
"typings/browser.d.ts",
"typings/browser",
"dist",
"node_modules",
".vscode"
]
}
Thinking the problem is the lib parameter in tsconfig.json. Any ideas?
Try upgrading TypeScript.
Running 2.1.5 now. Should I upgrade to RC 2.2?
Not sure if ts-node is picking up the correct version then...
Figured it out.
You have to install typescript globally to get ts-node to run the demo/index.ts:
npm install -g typescript
I had only installed it with the local package.json (npm install).
Thanks for the tip. :-)
i also have the same problem . i have done
npm install -g typescript
and my current version is 2.6.2 but still it is giving tsc : error TS5023: Build:Unknown compiler option 'lib' error . Please help.