离子 2 : "npm install"后发出警告



我使用 Ionic v2.1.8,当我运行命令"npm install"时,我有很多这样的警告:

C:xampphtdocsAppFineMobile>npm install
npm WARN @angular/compiler@2.4.8 requires a peer of @angular/core@2.4.8 but none was installed.
npm WARN @angular/compiler-cli@2.4.8 requires a peer of @angular/core@2.4.8 but none was installed.
npm WARN @angular/forms@2.4.8 requires a peer of @angular/core@2.4.8 but none was installed.
npm WARN @angular/forms@2.4.8 requires a peer of @angular/common@2.4.8 but none was installed.
npm WARN @angular/http@2.4.8 requires a peer of @angular/core@2.4.8 but none was installed.
npm WARN @angular/http@2.4.8 requires a peer of @angular/platform-browser@2.4.8 but none was installed.
npm WARN @angular/platform-browser-dynamic@2.4.8 requires a peer of @angular/core@2.4.8 but none was installed.
npm WARN @angular/platform-browser-dynamic@2.4.8 requires a peer of @angular/common@2.4.8 but none was installed.
npm WARN @angular/platform-browser-dynamic@2.4.8 requires a peer of @angular/platform-browser@2.4.8 but none was installed.
npm WARN @angular/platform-server@2.4.8 requires a peer of @angular/core@2.4.8 but none was installed.
npm WARN @angular/platform-server@2.4.8 requires a peer of @angular/common@2.4.8 but none was installed.
npm WARN @angular/platform-server@2.4.8 requires a peer of @angular/platform-browser@2.4.8 but none was installed.
npm WARN ionic-angular@2.2.0 requires a peer of @angular/common@2.4.8 but none was installed.
npm WARN ionic-angular@2.2.0 requires a peer of @angular/core@2.4.8 but none was installed.
npm WARN ionic-angular@2.2.0 requires a peer of @angular/platform-browser@2.4.8 but none was installed.
npm WARN ionic-angular@2.2.0 requires a peer of rxjs@5.0.1 but none was installed.
npm WARN ionic-angular@2.2.0 requires a peer of zone.js@0.7.2 but none was installed.

我的包.json 文件:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "test": "ng test"
  },
  "config": {
    "ionic_copy": "./config/copy.config.js"
  },
  "dependencies": {
    "@angular/common": "^2.4.0",
    "@angular/compiler": "^2.4.0",
    "@angular/compiler-cli": "^2.4.0",
    "@angular/core": "^2.4.0",
    "@angular/forms": "^2.4.0",
    "@angular/http": "^2.4.0",
    "@angular/platform-browser": "^2.4.0",
    "@angular/platform-browser-dynamic": "^2.4.0",
    "@angular/platform-server": "^2.4.0",
    "@angular/router": "^3.4.0",
    "@ionic/storage": "2.0.0",
    "font-awesome": "^4.7.0",
    "ionic-angular": "2.2.0",
    "ionic-native": "2.4.1",
    "ionicons": "3.0.0",
    "rxjs": "^5.1.0",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.7.6"
  },
  "devDependencies": {
    "@angular/cli": "^1.0.0",
    "@ionic/app-scripts": "1.1.4",
    "codecov": "^2.1.0",
    "jasmine-core": "^2.5.2",
    "karma": "^1.5.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-jasmine": "^1.1.0",
    "karma-mocha-reporter": "^2.2.3",
    "karma-remap-istanbul": "^0.6.0",
    "typescript": "2.0.9"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "ionic-plugin-keyboard",
    "cordova-plugin-splashscreen"
  ],
  "cordovaPlatforms": [],
  "description": "AppFineMobile: An Ionic project"
}

我不明白,因为我的node_modules文件夹中有这些模块。当我尝试安装其中一个时,我会在另一个 npm 安装中保持警告。

我真的不明白,我不知道如何解决这个问题

您只需要将所有angular packages更新为 2.4.8 。此外,您的ionic-angular包是2.2.0

改变:

"@angular/common": "^2.4.8",
"@angular/compiler": "^2.4.8",
"@angular/compiler-cli": "^2.4.8",
"@angular/core": "^2.4.8",
"@angular/forms": "^2.4.8",
"@angular/http": "^2.4.8",
"@angular/platform-browser": "^2.4.8",
"@angular/platform-browser-dynamic": "^2.4.8",
"@angular/platform-server": "^2.4.8",

"rxjs": "^5.0.1",
"zone.js" :"0.7.2"

在出现问题时清除node_modules文件夹,然后执行以下操作: npm install

相关内容

  • 没有找到相关文章

最新更新