目标入口点“@angular/material/input”缺少依赖项:

时间:2021-02-07 18:37:30

标签: angular angular-material

我真的很想使用有棱角的材料,应该不会这么难。我安装了这个包,当我尝试使用 matInput 时,我在构建时出错。如果发布 package.json 会有所帮助,请告诉我。

目标入口点“@angular/material/input”中的错误缺少依赖项:

  • @angular/core
  • @angular/forms
  • rxjs

package.json

{
  "name": "",
  "version": "1.0.0",
  "private": true,
  "description": "Example project from an angular.io guide.",
  "scripts": {
    "ng": "ng",
    "build": "ng build",
    "start": "ng serve",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
  },
  "keywords": [],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@angular/animations": "~10.0.2",
    "@angular/cdk": "^10.0.1",
    "@angular/common": "~10.0.2",
    "@angular/compiler": "~10.0.2",
    "@angular/core": "~10.0.2",
    "@angular/forms": "~10.0.2",
    "@angular/platform-browser": "~10.0.2",
    "@angular/platform-browser-dynamic": "~10.0.2",
    "@angular/platform-server": "~10.0.2",
    "@angular/router": "~10.0.2",
    "@angular/upgrade": "~10.0.2",
    "@nguniversal/express-engine": "^10.0.1",
    "angular-in-memory-web-api": "~0.9.0",
    "angular-mydatepicker": "^0.10.0",
    "aspnet-prerendering": "^3.0.1",
    "bootstrap-css-only": "4.4.1",
    "express": "^4.15.2",
    "jquery": "^3.5.0",
    "jqwidgets-ng": "^11.0.1",
    "mydatepicker": "^9.0.1",
    "ng2-toastr": "^4.1.2",
    "ng6-toastr-notifications": "^1.0.4",
    "ngx-device-detector": "^1.4.2",
    "ngx-mask": "^9.1.2",
    "ngx-toastr": "^12.0.1",
    "primeflex": "^2.0.0-rc.1",
    "primeicons": "^4.0.0",
    "primeng": "^9.1.3",
    "rxjs": "~6.5.4",
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1000.1",
    "@angular/cli": "~10.0.1",
    "@angular/compiler-cli": "~10.0.2",
    "@angular/language-service": "^10.0.2",
    "@nguniversal/builders": "^9.1.0",
    "@types/express": "^4.17.0",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~3.3.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "lodash": "^4.17.19",
    "tslib": "^2.0.0",
    "typescript": "~3.9.6"
  },

1 个答案:

答案 0 :(得分:0)

  1. 我在 package.json 中没有看到 @angular/material。
  2. 您是否在使用 MatInput 的模块的导入中包含 FormsModule(或其他可能的依赖项)?
  3. 如果没有任何效果,请删除 node_modules 文件夹并再次运行 npm install。