如果我使用2.0.0-beta.0,为什么我会收到angularfire 2.0.0-beta.2 npm警告?

时间:2016-08-11 06:51:39

标签: angular firebase npm ionic2 angularfire2

我的项目在package.json中使用angularfire 2.0.0-beta.0 ......

"angularfire2": "^2.0.0-beta.0"

...但是在npm install之后我收到有关angularfire 2.0.0-beta.2的npm警告:

npm WARN angularfire2@2.0.0-beta.2 requires a peer of @angular/core@2.0.0-rc.2 but none was installed.
npm WARN angularfire2@2.0.0-beta.2 requires a peer of @angular/platform-browser@2.0.0-rc.2 but none was installed.
npm WARN angularfire2@2.0.0-beta.2 requires a peer of @angular/common@2.0.0-rc.2 but none was installed.
npm WARN angularfire2@2.0.0-beta.2 requires a peer of @angular/compiler@2.0.0-rc.2 but none was installed.
npm WARN angularfire2@2.0.0-beta.2 requires a peer of @angular/platform-browser-dynamic@2.0.0-rc.2 but none was installed.
npm WARN angularfire2@2.0.0-beta.2 requires a peer of firebase@^3.0.3 but none was installed.

我看了node_modules/angularfire2,其package.json看起来像这样(注意它提到了2.0.0-beta.0和2.0.0-beta.2):

{
  "_args": [
    [
      {
        "raw": "angularfire2@^2.0.0-beta.0",
        "scope": null,
        "escapedName": "angularfire2",
        "name": "angularfire2",
        "rawSpec": "^2.0.0-beta.0",
        "spec": ">=2.0.0-beta.0 <3.0.0",
        "type": "range"
      },
      "/Users/nunoarruda/repos/zee-p3-app"
    ]
  ],
  "_from": "angularfire2@>=2.0.0-beta.0 <3.0.0",
  "_id": "angularfire2@2.0.0-beta.2",
  "_inCache": true,
  "_installable": true,
  "_location": "/angularfire2",
  "_nodeVersion": "5.10.1",
  "_npmOperationalInternal": {
    "host": "packages-16-east.internal.npmjs.com",
    "tmp": "tmp/angularfire2-2.0.0-beta.2.tgz_1466557136126_0.8304361375048757"
  },
  "_npmUser": {
    "name": "angularcore",
    "email": "angular-core+npm@google.com"
  },
  "_npmVersion": "3.8.3",
  "_phantomChildren": {},
  "_requested": {
    "raw": "angularfire2@^2.0.0-beta.0",
    "scope": null,
    "escapedName": "angularfire2",
    "name": "angularfire2",
    "rawSpec": "^2.0.0-beta.0",
    "spec": ">=2.0.0-beta.0 <3.0.0",
    "type": "range"
  },
  "_requiredBy": [
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/angularfire2/-/angularfire2-2.0.0-beta.2.tgz",
  "_shasum": "1455af597a789e6da206a6eefff87851dddb11e7",
  "_shrinkwrap": null,
  "_spec": "angularfire2@^2.0.0-beta.0",
  "_where": "/Users/nunoarruda/repos/zee-p3-app",
  "author": {
    "name": "jeffbcross"
  },
  "bugs": {
    "url": "https://github.com/angular/angularfire2/issues"
  },
  "dependencies": {},
  "description": "<p align=\"center\">   <h1 align=\"center\">AngularFire2</h1>   <p align=\"center\">The official library for Firebase and Angular 2</p> </p>",
  "devDependencies": {
    "conventional-changelog-cli": "^1.2.0",
    "es6-module-loader": "^0.17.10",
    "es6-shim": "^0.35.0",
    "firebase-server": "^0.5.2",
    "gulp": "^3.9.0",
    "gulp-jasmine": "^2.2.1",
    "gulp-typescript": "^2.10.0",
    "http-server": "^0.8.5",
    "jasmine": "^2.4.1",
    "jasmine-core": "^2.4.1",
    "json": "^9.0.3",
    "karma": "^0.13.19",
    "karma-chrome-launcher": "^0.2.2",
    "karma-firefox-launcher": "^0.1.7",
    "karma-jasmine": "^0.3.6",
    "karma-mocha-reporter": "^2.0.2",
    "karma-systemjs": "^0.10.0",
    "parse5": "^1.3.2",
    "protractor": "3.0.0",
    "reflect-metadata": "0.1.2",
    "systemjs": "^0.19.16",
    "systemjs-builder": "^0.15.7",
    "traceur": "0.0.96",
    "tsd": "^0.6.5",
    "typedoc": "github:jeffbcross/typedoc",
    "typescript": "^1.8.10",
    "typings": "^0.6.2",
    "zone.js": "^0.6.6"
  },
  "directories": {},
  "dist": {
    "shasum": "1455af597a789e6da206a6eefff87851dddb11e7",
    "tarball": "https://registry.npmjs.org/angularfire2/-/angularfire2-2.0.0-beta.2.tgz"
  },
  "homepage": "https://github.com/angular/angularfire2#readme",
  "jsnext:main": "./es6/angularfire2.js",
  "keywords": [
    "angular2",
    "angular",
    "firebase"
  ],
  "license": "MIT",
  "main": "./angularfire2.js",
  "maintainers": [
    {
      "name": "angularcore",
      "email": "angular-core+npm@google.com"
    },
    {
      "name": "davideast",
      "email": "dceast@gmail.com"
    },
    {
      "name": "jeffbcross",
      "email": "middlefloor@gmail.com"
    }
  ],
  "name": "angularfire2",
  "optionalDependencies": {},
  "peerDependencies": {
    "@angular/core": "2.0.0-rc.2",
    "@angular/platform-browser": "2.0.0-rc.2",
    "@angular/common": "2.0.0-rc.2",
    "@angular/compiler": "2.0.0-rc.2",
    "@angular/platform-browser-dynamic": "2.0.0-rc.2",
    "firebase": "^3.0.3",
    "rxjs": "5.0.0-beta.6"
  },
  "readme": "ERROR: No README data found!",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/angular/angularfire2.git"
  },
  "scripts": {
    "build": "rm -rf dist; tsc",
    "build_bundle": "cp -r src angularfire2 && tsc typings/main.d.ts angularfire2.ts --rootDir . --module system -t es5 --outFile dist/bundles/angularfire2.js  --moduleResolution node --emitDecoratorMetadata --experimentalDecorators",
    "build_e2e": "rm -rf dist-test && npm run build && tsc -p test/ && cp test/e2e/firebase_object/index.html dist-test/e2e/firebase_object/ && cp test/e2e/firebase_list/index.html dist-test/e2e/firebase_list/ && cp test/e2e/auth/index.html dist-test/e2e/auth/",
    "build_npm": "rm -rf dist && tsc -p tsconfig.publish.es5.json && tsc -p tsconfig.publish.es6.json",
    "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
    "docs": "typedoc --out docs/api/ --module commonjs --mode modules --name AngularFire2 src",
    "e2e_test": "webdriver-manager update && npm run build_e2e && protractor",
    "postbuild_npm": "cp manual_typings/firebase3/firebase3.d.ts package.json README.md .npmignore dist/ && npm run rewrite_npm_package",
    "rewrite_npm_package": "node --harmony_destructuring tools/rewrite-published-package.js",
    "test": "npm run build; karma start"
  },
  "typings": "angularfire2.d.ts",
  "version": "2.0.0-beta.2"
}

关于这里的问题有什么想法吗?

这个完全相同的项目与这个完全相同的代码在2个月前工作正常。我正在使用Node v6.3.1,npm v3.10.6和Mac OS X El Capitan。

1 个答案:

答案 0 :(得分:1)

安装了beta.2版本是因为package.json - ^2.0.0-beta.0中的semver是caret range2.0.0-beta.2满足该范围。

上次使用npm install执行package.json时,版本2.0.0-beta.0可能是最新发布的版本。

随着2.0.0-beta.2的发布,您将安装它,因为它是最新发布的包,它满足您正在使用的semver范围。

如果您特别希望安装2.0.0-beta.0,请从范围中删除插入符号:

"angularfire2": "2.0.0-beta.0"