When trying to use Angular 2.0 (beta) in Visual Studio 2015, the TypeScript compiler generated the following error message:
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found.
Here is the package.json I was using:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "angular2-quickstart", | |
"version": "1.0.0", | |
"scripts": { | |
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", | |
"lite": "lite-server", | |
"postinstall": "", | |
"tsc": "tsc", | |
"tsc:w": "tsc -w", | |
"typings": "typings" | |
}, | |
"license": "ISC", | |
"dependencies": { | |
"angular2": "2.0.0-beta.17", | |
"systemjs": "0.19.27", | |
"es6-shim": "^0.35.0", | |
"reflect-metadata": "^0.1.3", | |
"rxjs": "5.0.0-beta.4", | |
"zone.js": "^0.6.12", | |
"bootstrap": "^3.3.6" | |
}, | |
"devDependencies": { | |
"concurrently": "^2.0.0", | |
"lite-server": "^2.2.0", | |
"typescript": "^1.8.10", | |
"typings":"^0.8.1" | |
} | |
} |
The problem seems to be related to the combination of the RxJs and Angular version I was using. To fix it, I had to change the RxJs version from
"rxjs": "5.0.0-beta.4"
to
"rxjs": "5.0.0-beta.2"
After NPM installed the correct packages, the TypeScript error disappeared.