我在运行 Angular 应用程序时遇到问题

时间:2021-07-26 10:49:42

标签: angular

我正在尝试在我的本地机器上运行一个 angular 应用程序。我收到很多错误。请查看快照 s1 第 8 行 ...import { ModalModule } from "ngx-bootstrap" 因为我已经完成了 npm install 并使用命令 npm install ngx-bootstrap 在我的项目中安装了引导程序bootstrap --save 但仍然是为什么我在 s1 快照中出现错误下划线,请您帮我解决这个问题。enter image description here

package.json

{
  "name": "opdk-ui",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~8.2.0",
    "@angular/common": "~8.2.0",
    "@angular/compiler": "~8.2.0",
    "@angular/core": "~8.2.0",
    "@angular/forms": "~8.2.0",
    "@angular/platform-browser": "~8.2.0",
    "@angular/platform-browser-dynamic": "~8.2.0",
    "@angular/router": "~8.2.0",
    "@circlon/angular-tree-component": "^10.0.0",
    "@ng-select/ng-select": "^2.18.0",
    "@swimlane/ngx-datatable": "^15.0.0",
    "angular-tree-component": "^8.5.6",
    "bootstrap": "^5.0.2",
    "core-js": "^3.2.1",
    "loadsh": "0.0.4",
    "moment": "^2.22.2",
    "ng2-ace-editor": "^0.3.9",
    "ngx-bootstrap": "^5.6.2",
    "ngx-spinner": "^8.0.3",
    "ngx-toastr": "^10.2.0",
    "rxjs": "~6.4.0",
    "tslib": "^1.10.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.802.2",
    "@angular/cli": "~8.2.1",
    "@angular/compiler-cli": "~8.2.0",
    "@angular/language-service": "~8.2.0",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.5.3"
  }
}

1 个答案:

答案 0 :(得分:1)

如果你已经有

npm install

yarn

尝试完全关闭并重新打开 vscode,有时在安装依赖项后编辑器不会刷新。 否则,您可能需要提供 mroe 详细的错误消息。