在我的 Ionic 2 项目中,我尝试 npm install ng2-pdf-viewer --save
这导致: ├── 未满足的对等依赖关系 @angular/core@2.1.1
└─┬ ng2-pdf-viewer@1.0.1
└── @types/pdf@0.0.31
npm WARN ng2-pdf-viewer@1.0.1 需要 @angular/core@^2.2.1 的对等体 但没有安装任何内容。
我该如何解决这个问题?
我的包.json包括:
"dependencies": {
"@angular/common": "2.1.1",
"@angular/compiler": "2.1.1",
"@angular/compiler-cli": "2.1.1",
"@angular/core": "2.1.1",
"@angular/forms": "2.1.1",
"@angular/http": "2.1.1",
"@angular/platform-browser": "2.1.1",
"@angular/platform-browser-dynamic": "2.1.1",
"@angular/platform-server": "2.1.1",
"@ionic/storage": "1.1.6",
"@types/moment": "^2.13.0",
"font-awesome": "^4.7.0",
"ionic-angular": "2.0.0-rc.3",
"ionic-native": "2.2.3",
"ionicons": "3.0.0",
"jquery": "^3.1.1",
"moment": "^2.17.1",
"ng2-pdf-viewer": "^1.0.1",
"pdfjs-dist": "^1.6.483",
"rxjs": "5.0.0-beta.12",
"ts-md5": "^1.2.0",
"zone.js": "0.6.26"
}
要使用ng2-pdf-viewer
您需要拥有angular 2.2.1
或更多。您可能需要更新package.json中的所有角度依赖项[angular/core,http,compiler-cli等]才能2.2.1^
和检查。您可以在此处参考最新的 ionic 2 软件包依赖项。