Angular 4、angularfire2、元数据版本不匹配 [英] Angular 4, angularfire2, Metadata version mismatch

查看:27
本文介绍了Angular 4、angularfire2、元数据版本不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下错误

模块 c:/..../node_modules/angularfire2/index.d.ts 的元数据版本不匹配,发现版本 4,预期为 3.

Metadata version mismatch for module c:/..../node_modules/angularfire2/index.d.ts, found version4, expected 3.

如果我去检查我的 package.json,我在 5.0.0-rc.4 版本上有 angularfire2,在 4.6.2 上有 firebase.详情见截图

And if I go and check in my package.json, I have angularfire2 on version 5.0.0-rc.4, and firebase on 4.6.2. see screenshot for details

我尝试将 angularfire2 和 firebase 的版本更改为以前的版本,但没有任何效果.

I tried changing the version of angularfire2 and firebase to previous versions but nothing worked.

有什么建议吗?谢谢.

{
  "name": "twitter-revamped",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "angularfire2": "^5.0.0-rc.4",
    "core-js": "^2.4.1",
    "firebase": "^4.6.2",
    "ng2-semantic-ui": "^0.9.6",
    "rxjs": "<5.4.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.4.7",
    "@angular/compiler-cli": "^4.2.4",
    "@angular/language-service": "^4.2.4",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.2.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.7.0",
    "typescript": "~2.3.3"
  }
}

推荐答案

我解决了

必须将 firebase 和 angularfire2 设置为:

Had to set firebase and angularfire2 to this:

"firebase":"4.6.0","angularfire2": "5.0.0-rc.3"

但后来我又犯了一个错误:
"@angular/compiler-cli" 包没有正确安装.错误:错误:找不到模块'@angular/compiler-cli'

but then I got another error:
"@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'

一个 npm install 修复了它.

A npm install fixed it.

这篇关于Angular 4、angularfire2、元数据版本不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆