Cannot find type definition file for 'core-js'

Adil Malik

I am building an angular2 application with angular-cli. angular-in-memory-web-api was not installed by default.

So I searched for it and added this line "angular-in-memory-web-api": "~0.1.5" in my package.json file. And did npm install.

Now I am having this issue.

ERROR in [default] /home/adil/Code/AngularJS.2/cli-based/mz-doc-app/node_modules/angular-in-memory-web-api/in-memory-backend.service.d.ts:1:0 
Cannot find type definition file for 'core-js'.

Please suggest some solution ?

package.json

{
  "name": "mz-doc-app",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~2.1.0",
    "@angular/compiler": "~2.1.0",
    "@angular/core": "~2.1.0",
    "@angular/forms": "~2.1.0",
    "@angular/http": "~2.1.0",
    "@angular/material": "^2.0.0-alpha.9-3",
    "@angular/platform-browser": "~2.1.0",
    "@angular/platform-browser-dynamic": "~2.1.0",
    "@angular/router": "~3.1.0",
    "@types/core-js": "^0.9.34",
    "angular-in-memory-web-api": "~0.1.5",
    "core-js": "^2.4.1",
    "rxjs": "5.0.0-beta.12",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@types/jasmine": "^2.2.30",
    "@types/node": "^6.0.42",
    "angular-cli": "1.0.0-beta.18",
    "codelyzer": "1.0.0-beta.1",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.9",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "~2.0.3"
  }
}
Xamrix

I solved the problem by deleting the first line /// <reference types="core-js" /> of node_modules/angular-in-memory-web-api/in-memory-backend.service.d.ts

It's not a permanent solution but wait for a fix (https://github.com/angular/in-memory-web-api/issues/62)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Cannot find type definition file for 'ramda'

Build:Cannot find type definition file for 'node'

Angular 7: cannot find the type definition file

Using Jest I get: Cannot find type definition file for 'jasmine'

error TS2688: Cannot find type definition file for 'dist'

error TS2688: Cannot find type definition file for 'bson'

error TS2688: Cannot find type definition file for 'ioredis'

XML file, XSD schema Errors: Cannot resolve the name to a(n) 'type definition', Cannot find the declaration of element

Typescript cannot find method in definition file

TS2688: Cannot find type definition file for 'node' with @types/node installed

ERROR in error TS2688: Cannot find type definition file for 'jest'

Cannot find type definition file for 'redux-logger' error in tsconfig.json

TypeScript error in undefined(undefined,undefined): Cannot find type definition file for 'src'. TS2688

cannot find js file

Type Definition file for Keycloak.js

After typescript update 2.3.4 => 2.4.2 i get compilation error "Cannot find type definition file for 'reflect-metadata'."

Cannot find the definition of a constant

TypeScript Definition File Cannot Find .d.ts

I cannot find the definition of a method in node.js source code

Cannot find local module (js file) in Electron

Cannot find _app.js file in nextJs

Package type definition cannot be found

CMake cannot find source file, but file was not specified in CMakeLists.txt, in TFS build definition

Compile on heroku node ts- jest types- cannot find type definition

ASP.NET Core The system cannot find the file specified

.NET Core .dll cannot find or open the symbol file

npm error Cannot find module './config/core.js'

How to convert custom type definition file to npm type definition file

File System (fs) cannot find a file with space in it (Node js)

TOP Ranking

HotTag

Archive