Mayank Bansal
Mayank Bansal

Reputation: 73

Cannot find type definition file for 'core-js'

I am working on Angular2 project and using angular2-tree component for handling tree structure. After installing tree component and when I do npm start, I am getting below error:

I googled this error and find the work-around for this of removing commented line from one of its TS file. I am trying to find the root cause of this error and the proper solution of this.

Below are the version details of my project:

  1. angular2-tree-component: ^2.6.1
  2. core-js: ^2.4.1

Below is the file name and the commented line which I deleted as a work-around.

File Name: tree-node.model.d.ts

Code : /// <reference types="core-js" />

Any lead on this will be helpful and let me know for any missing details.

Upvotes: 1

Views: 4008

Answers (1)

NewtonCode
NewtonCode

Reputation: 1542

From typescript v2.0 , typings need not be mentioned as reference tag.

Instead you can install typings as:

npm install --save-dev @types/core-js 

tsc automatically looks for typings in @types folder in node_modules

This should solve the problem

Upvotes: 3

Related Questions