javascript – 找不到’core-js’的类型定义文件

我正在构建一个angular-cli的angular2应用程序.认情况下未安装angular-in-memory-web-api.

所以我搜索了它并在我的package.json文件添加了这行“angular-in-memory-web-api”:“~0.1.5”.并安装了npm.

现在我遇到了这个问题.

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'.

请建议一些解决方案?

的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"
  }
}

解决方法

我通过删除第一行来解决了这个问题///< reference types =“core-js”/> of node_modules / angular-in-memory-web-api / in-memory-backend.service.d.ts

这不是一个永久的解决方案,而是等待修复(https://github.com/angular/in-memory-web-api/issues/62)

相关文章

前言 做过web项目开发的人对layer弹层组件肯定不陌生,作为l...
前言 前端表单校验是过滤无效数据、假数据、有毒数据的第一步...
前言 图片上传是web项目常见的需求,我基于之前的博客的代码...
前言 导出Excel文件这个功能,通常都是在后端实现返回前端一...
前言 众所周知,js是单线程的,从上往下,从左往右依次执行,...
前言 项目开发中,我们可能会碰到这样的需求:select标签,禁...