After following the Angular2 quick start guide to set up my project, I encountered a persistent error when running the "tsc -w" command in the command line:
app/components/company/company.ts(1,36): error TS2307: Cannot find module '@angular/core'.
app/components/company/company.ts(5,22): error TS2307: Cannot find module '@angular/router'.
app/components/mission/mission.ts(1,36): error TS2307: Cannot find module '@angular/core'.
app/components/mission/mission.ts(3,22): error TS2307: Cannot find module '@angular/router'.
Despite these errors, the compilation is successful and the application functions properly. However, the constant warnings can be distracting.
The setup includes Angular2 rc1, TypeScript 1.8.10, and WebStorm EAP, although I am not using WebStorm's TypeScript compilation system but relying on an open terminal with the "tsc -w" command instead.
I have searched for solutions on Stack Overflow without finding a resolution that resolves this issue for me.
Update
Here is an excerpt from my tsconfig.json file:
{
"compilerOptions": {
"target": "es5",
"sourceMap": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "system",
"noImplicitAny": false,
"outDir": "js",
"rootDir": "app"
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}