Angular 2 ERROR in ./~/@angular/material/esm5/icon.es5.js

时间:2017-12-11 21:16:55

标签: angular

我执行命令ng serve并发生错误

  

(错误在./~/@angular/material/esm5/icon.es5.js找不到模块:   错误:无法解析'@ angular / common / http'   'd:\ study_project \书店棱角\管理门户\ node_modules \ @angular \材料\ esm5')

我的package.json写在下面

"dependencies": {
    "@angular/cdk": "github:angular/cdk-builds",
    "@angular/common": "^2.4.0",
    "@angular/compiler": "^2.4.0",
    "@angular/core": "^2.4.0",
    "@angular/forms": "^2.4.0",
    "@angular/http": "^2.4.0",
    "@angular/material": "github:angular/material2-builds",
    "@angular/platform-browser": "^2.4.10",
    "@angular/platform-browser-dynamic": "^2.4.0",
    "@angular/router": "^3.4.0",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "rxjs": "^5.1.0",
    "zone.js": "^0.7.6"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0-rc.1",
    "@angular/compiler-cli": "^2.4.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.4.2",
    "typescript": "~2.0.0"
  }
}

1 个答案:

答案 0 :(得分:1)

只需运行命令npm update和npm install并重新启动编辑器或应用程序