Angular 6 - 更新有效但大多数导入错误 - '无法找到模块...'

时间:2018-06-04 09:50:59

标签: angular angular-cli angular6

我已升级到Angular 6,包括最新版本的Angular Material和RxJS,但我的很多@angular导入都显示了' 无法找到模块 .. 。'尽管我的node_modules文件夹中存在模块,但VSCode中存在错误。

运行应用程序本身没有问题,一切正常,因为更新rxjs并更改角度材质的一些属性指令,但我在每个文件中都出现了很多警告。

的package.json:

{
  "name": "angular-5-firebase",
  "version": "0.0.0",
  "license": "MIT",
  "main": "main.js",
  "build": {
    "appId": "NickWCook.Angular5FirebaseFinanceManager",
    "productName": "Angular 5 Firebase Finance Manager"
  },
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test --browser ChromeHeadless",
    "watch": "ng test --browser ChromeHeadless",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "deploy": "ng build --prod && firebase deploy",
    "electron": "electron .",
    "electron-build": "ng build --prod && electron .",
    "pack": "electron-builder --dir",
    "dist": "electron-builder"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.0.3",
    "@angular/cdk": "^6.2.0",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/flex-layout": "6.0.0-beta.15",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/material": "^6.2.0",
    "@angular/material-moment-adapter": "^6.2.0",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "@firebase/app-types": "^0.3.1",
    "@types/es6-promise": "^3.3.0",
    "@types/lodash": "^4.14.108",
    "angular-in-memory-web-api": "0.6.0",
    "angularfire2": "^5.0.0-rc.10",
    "core-js": "^2.4.1",
    "firebase": "^5.0.4",
    "global": "^4.3.2",
    "hammerjs": "^2.0.8",
    "jasmine": "^3.1.0",
    "lodash": "^4.17.10",
    "moment": "^2.21.0",
    "rxjs": "^6.2.0",
    "rxjs-compat": "^6.2.0",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.7.0-beta.1",
    "@angular/cli": "^6.0.7",
    "@angular/compiler-cli": "^6.0.3",
    "@angular/language-service": "^6.0.3",
    "@types/faker": "^4.1.2",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "electron": "^1.8.4",
    "faker": "^4.1.0",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ngx-electron": "^1.0.4",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "2.7.2"
  },
  "repository": "https://github.com/nickwcook/firebase-work.git",
  "author": "Nick Cook <nick@nickwcook.com>"
}

1 个答案:

答案 0 :(得分:0)

很可能VS工作室仍在使用.angular-cli.json而不是.angular.json您可能需要等待更新。我有一个类似的问题使用Webclipse