I am using angular 2.0.0-rc.1, but am struggling with the typescript compiler (Typescript 1.8.10). If I run tsc on my project, I get loads of errors like this:
app/app.component.ts(1,33): error TS2307: Cannot find module '@angular/core'
However, I thought that because the package.json
in node_modules/@angular/core has the line:
"typings": "index.d.ts",
and index.d.ts
provides the definitions, this shouldn't be the case? VSCode doesn't highlight any issues with these packages and will link through to the source if I click "Go to Definition" on the imports.
What should I do to avoid compiler errors like this?
Update:
My packages.json
:
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true
},
"exclude": [
"node_modules",
"platforms"
]
}