Node.js Angular2:npm更新后,我的应用程序坏了

Node.js Angular2:npm更新后,我的应用程序坏了,node.js,angular,npm,angular-cli,package.json,Node.js,Angular,Npm,Angular Cli,Package.json,我的angular 2/cli项目有问题 我已经更新了我的npm软件包,但之后,当我使用ng serve时,我会发现以下错误: Time: 12752ms chunk {0} main.bundle.js, main.bundle.map (main) 45.3

我的angular 2/cli项目有问题

我已经更新了我的npm软件包,但之后,当我使用ng serve时,我会发现以下错误:

Time: 12752ms                                                                                                              

    chunk    {0} main.bundle.js, main.bundle.map (main) 45.3 kB {2} [initial] [rendered]                                           
chunk    {1} styles.bundle.css, styles.bundle.map, styles.bundle.map (styles) 20.6 kB {3} [initial] [rendered]
chunk    {2} vendor.bundle.js, vendor.bundle.map (vendor) 3.52 MB [initial] [rendered]
chunk    {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]

ERROR in AppModule is not an NgModule

ERROR in ./src/app/shared/guards/unauth-guard.ts
Module build failed: Error: /Users/nicolas/Desktop/Dilit/seller-app/src/app/shared/guards/unauth-guard.ts (16,8): Property 'take' does not exist on type 'AngularFireAuth'.)
    at _checkDiagnostics (/Users/nicolas/Desktop/Dilit/seller-app/node_modules/@ngtools/webpack/src/loader.js:116:15)
    at /Users/nicolas/Desktop/Dilit/seller-app/node_modules/@ngtools/webpack/src/loader.js:141:17
 @ ./src/app/app.module.ts 23:0-59
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

ERROR in ./src/app/shared/guards/auth-guard.ts
Module build failed: Error: /Users/nicolas/Desktop/Dilit/seller-app/src/app/shared/guards/auth-guard.ts (17,8): Property 'take' does not exist on type 'AngularFireAuth'.)
    at _checkDiagnostics (/Users/nicolas/Desktop/Dilit/seller-app/node_modules/@ngtools/webpack/src/loader.js:116:15)
    at /Users/nicolas/Desktop/Dilit/seller-app/node_modules/@ngtools/webpack/src/loader.js:141:17
 @ ./src/app/app.module.ts 24:0-55
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

ERROR in ./src/app/application/application.component.ts
Module not found: Error: Can't resolve 'application.frame.component.html' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application'
 @ ./src/app/application/application.component.ts 39:18-61
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

ERROR in ./src/app/application/dashboard/dashboard.component.ts
Module not found: Error: Can't resolve 'dashboard.component.html' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application/dashboard'
 @ ./src/app/application/dashboard/dashboard.component.ts 63:18-53
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

ERROR in ./src/app/application/dashboard/dashboard.component.ts
Module not found: Error: Can't resolve 'dashboard.component.scss' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application/dashboard'
 @ ./src/app/application/dashboard/dashboard.component.ts 64:17-52
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

ERROR in ./src/app/application/campaign/campaign.component.ts
Module not found: Error: Can't resolve 'campaign.component.html' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application/campaign'
 @ ./src/app/application/campaign/campaign.component.ts 81:18-52
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

ERROR in ./src/app/application/campaign/campaign.component.ts
Module not found: Error: Can't resolve 'campaign.component.scss' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application/campaign'
 @ ./src/app/application/campaign/campaign.component.ts 82:17-51
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main
webpack: bundle is now VALID.
即使我返回到旧的package.json配置,我也无法构建我的项目

这是my package.json:

{
  "name": "seller-app",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "2.4.1",
    "@angular/compiler": "2.4.1",
    "@angular/core": "2.4.1",
    "@angular/forms": "2.4.1",
    "@angular/http": "2.4.1",
    "@angular/platform-browser": "2.4.1",
    "@angular/platform-browser-dynamic": "2.4.1",
    "@angular/router": "3.4.1",
    "@types/node": "^6.0.53",
    "angularfire2": "^2.0.0-beta.7-pre",
    "core-js": "^2.4.1",
    "firebase": "^3.6.4",
    "ng2-img-cropper": "^0.7.6",
    "ng2-toastr": "^1.3.2",
    "rxjs": "5.0.2",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.7.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "2.4.1",
    "@types/jasmine": "2.5.40",
    "@types/node": "^6.0.42",
    "angular-cli": "1.0.0-beta.24",
    "codelyzer": "~2.0.0-beta.4",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.7.0",
    "karma": "1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.4.0",
    "protractor": "4.0.14",
    "ts-node": "2.0.0",
    "tslint": "4.2.0",
    "typescript": "~2.1.4",
    "webdriver-manager": "11.1.0"
  }
}

感谢您的帮助

我在将TypeScript升级到2.1.4时遇到了相同的错误。降级到TypeScript 2.1.1时存在错误。降级到TypeScript 2.0.8时,错误消失。

尝试将TypeScript降级到2.1。1@IgorJanković之后,我尝试使用“npm安装”,但我得到了完全相同的错误。我尝试返回到旧的angular cli/typescript/angular core,但没有任何效果。感谢您的帮助将package.json返回到旧版本,删除node_modules文件夹并运行npm install。对于与您编写的组件相关的一些错误,您必须修复HTML和CSS文件的路径。最新的CLI不再喜欢相对路径。大多数情况下,您必须在文件前添加一个
/
,错误表示无法解决。非常感谢@R.Richards我的应用程序现在又可以工作了。