3

I written a server for my angular 2 app in TypeScript.

When I try to compile it (tsc server.ts), I get an error. I never had this error before. I don't think I have added anything new. And what I know, there is no connection at all with angular 2 and my server.ts. I'm kinda out of options. All answers I found was about adding something to a angular 2 file.

Error message:

node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,15): error TS2304: Cannot find name 'Map'.
node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(28,16): error TS2304: Cannot find name 'Map'.
node_modules/@angular/core/src/di/reflective_provider.d.ts(87,123): error TS2304: Cannot find name 'Map'.
node_modules/@angular/core/src/di/reflective_provider.d.ts(87,165): error TS2304: Cannot find name 'Map'.
node_modules/@angular/core/src/facade/lang.d.ts(12,17): error TS2304: Cannot find name 'Map'.
node_modules/@angular/core/src/facade/lang.d.ts(13,17): error TS2304: Cannot find name 'Set'.

I don't know what is relevant to show, so if you don't mind - please ask for it.

1 Answer 1

1

you don't have typescript definition files of map, so :

npm install @types/core-js
Sign up to request clarification or add additional context in comments.

5 Comments

Hm.. It worked before. When I ran that command I got some new errors. I now have duplicates of promises. " Duplicate identifier 'Promise'." /@types/es6-promise and /@types/core-js
@types/core-js module contains all typescript definitions of ecmascript6
yes promises are defined in the @types/core-js so delete it : npm uninstall @types/es6-promise
It worked! But I can't understand why it worked for the past week. I have not added anything new. And it's impossible for you to answer.
hhh I'don't know , don't forget to mark my answer as solution ;)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.