{ "compilerOptions": { "target": "es5", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts" ] }
I'm trying to upgrade an angular2/beta8 app to RC1, and I'm doing so by basically restructuring according to the Quickstart guide.
I copied its tsconfig.json into my project directory. I think I've got everything else ready,but when I run tsc
, I get all kinds of errors within files in my node_modules folder. Why is it even looking in there in the first place?
To force TypeScript tsc to ignore node_modules folder, we can set the skipLibCheck option to true . to set the compilerOptions. skipLibCheck option to true in tsconfig. json to skip the node_modules folder check.
The tsconfig. json is generally put in the root folder of the project.
tsc is the TypeScript compiler, which is completely separate from ts-node . ts-node is a wrapper for Node. js's node executable that installs a TypeScript-enabled module loader that compiles TypeScript on the fly as needed. From its npm page: TypeScript Node works by registering the TypeScript compiler for .
Use the exclude option in your tsconfig. json file to exclude a folder from compilation in TypeScript. The exclude option changes what the include setting finds and defaults to node_modules and bower_components .
Add this option in tsconfig.json
{ "compilerOptions": { "skipLibCheck": true }, }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With