2

I am trying to configure an angular2+express project. I understand the cause of the problem, but not the correct solution. Here are the relevant parts of my package.json dependencies:

"dependencies": { "angular2": "2.0.0-beta.0", "express": "^4.13.3", "tsd": "^0.6.5", "typescript": "^1.4.1", <...lots of peer dependencies> }

Node 5.2.0 is installed globally. When I run tsd install, I get ./typings/node.d.ts pulled in, for what the comments claim to be v0.12.0 API. But this conflicts with angular2/typings/node/node.d.ts (which also claims v0.12.0). The .d.ts files are different, for example:

./node_modules/angular2/typings/node/node.d.ts ---> declare var global: NodeJS.Global; ./typings/node/node.d.ts ---> declare var global: any;

The result is a mass of TS2300: Duplicate identifier errors. I can hack around this by manually deleting ./typings/node and editing ./typings/express/express.d.ts to have:

/// <reference path="../../node_modules/angular2/typings/node/node.d.ts" />

Now everything works, but obviously this is just plain 'wrong'. What is the standard way to pull in expres.d.ts so it plays nice with Angular 2?

Ken
  • 797
  • 1
  • 5
  • 11
  • I think this issue may be related https://github.com/angular/angular/issues/5807 – Eric Martinez Dec 21 '15 at 04:20
  • Might also be related to [this](http://stackoverflow.com/questions/34207110/duplicate-identifier-errors-with-angular2-and-tsd). – Ken Dec 21 '15 at 04:57

0 Answers0