0

我不断收到错误,例如,下面有红色下划线

import { ViewChild, ViewContainerRef } from '@angular/core';
import { Component, OnInit } from '@angular/core';
Cannot find module '@angular/core'.
Cannot find module 'rxjs'。。。

但是,这并不是在所有文件中都会发生,比如在 50% 的文件中,它会出现错误,但其他 50% 都可以。我删除了 node_modules 文件夹和 package-lock.json 文件几次,并在删除这些文件后运行“npm install”。但我仍然收到所有这些错误。

下面是我的 package.json

{
  "name": "app",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^8.2.2",
    "@angular/common": "^8.2.2",
    "@angular/compiler": "^8.2.2",
    "@angular/core": "^8.2.2",
    "@angular/forms": "^8.2.2",
    "@angular/platform-browser": "^8.2.2",
    "@angular/platform-browser-dynamic": "^8.2.2",
    "@angular/router": "^8.2.2",
    "@ng-bootstrap/ng-bootstrap": "^5.1.0",
    "@progress/kendo-angular-buttons": "^5.0.1",
    "@progress/kendo-angular-common": "^1.1.4",
    "@progress/kendo-angular-dialog": "^4.1.0",
    "@progress/kendo-angular-editor": "^0.10.2",
    "@progress/kendo-angular-grid": "^4.4.0",
    "@progress/kendo-angular-l10n": "^2.0.0",
    "@progress/kendo-angular-label": "^2.0.2",
    "@progress/kendo-angular-layout": "^4.1.5",
    "@progress/kendo-data-query": "^1.5.2",
    "@progress/kendo-drawing": "^1.6.0",
    "@progress/kendo-theme-bootstrap": "^4.3.5",
    "bootstrap": "^4.3.1",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.6.5",
    "crypto-js": "^3.1.9-1",
    "jquery": "^1.9.1",
    "ng5-slider": "^1.1.13",
    "ngx-filter-pipe": "^2.1.2",
    "ngx-multi-window": "^0.3.2",
    "package.json": "^2.0.1",
    "popper.js": "^1.14.7",
    "rxjs": "^6.5.2",
    "rxjs-compat": "^6.4.0",
    "rxjs-tslint": "^0.1.7",
    "stacktrace-js": "^2.0.0",
    "tslib": "^1.9.3",
    "web-animations-js": "^2.3.2",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.802.2",
    "@angular/cli": "^8.2.2",
    "@angular/compiler-cli": "8.2.2",
    "@angular/language-service": "8.2.2",
    "@types/core-js": "^2.5.0",
    "@types/jasmine": "^3.3.9",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "^11.9.4",
    "codelyzer": "^5.0.1",
    "jasmine-core": "^3.3.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "^4.0.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-cli": "~2.0.0",
    "karma-coverage-istanbul-reporter": "^2.0.5",
    "karma-jasmine": "^2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "^5.4.2",
    "ts-node": "^8.0.2",
    "tslint": "^5.12.1",
    "typescript": "3.5.3"
  }
}
4

0 回答 0