Ionic 如何在爱奥尼亚角安装社交分享包?

wz3gfoph  于 2023-02-17  发布在  Ionic
关注(0)|答案(1)|浏览(188)

当使用ionic-native/social-sharing软件包时,我遇到以下错误:

Failed to initialize Angular compilation - The target entry-point "@ionic#6421-native/social-sharing" has missing dependencies:
 - rxjs/Observable
 - rxjs/observable/fromEvent
 - rxjs/observable/throw

我已经安装了rxjs。另外,当我安装ionic-native/social-sharing时,我必须使用--force,否则它不会安装。不使用--force会出现以下错误:

could not resolve dependency npm err peer rxjs 5.5 11 from ionic-native core 4.20 0

我能做些什么来解决这个问题呢?我只想使用@ionic-native/social-sharing软件包
编辑:删除node_modules并执行npm i后,当我执行npm i时,我会收到此错误:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @ionic-native/core@4.20.0
npm ERR! Found: rxjs@7.5.7
npm ERR! node_modules/rxjs
npm ERR!   rxjs@"~7.5.0" from the root project
npm ERR!   peer rxjs@"^6.5.3 || ^7.4.0" from @angular/common@15.1.4
npm ERR!   node_modules/@angular/common
npm ERR!     @angular/common@"^15.0.0" from the root project
npm ERR!     peer @angular/common@"15.1.4" from @angular/forms@15.1.4
npm ERR!     node_modules/@angular/forms
npm ERR!       @angular/forms@"^15.0.0" from the root project
npm ERR!       1 more (@ionic/angular)
npm ERR!     3 more (@angular/platform-browser, ...)
npm ERR!   5 more (@angular/core, @angular/forms, @angular/router, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"^5.5.11" from @ionic-native/core@4.20.0
npm ERR! node_modules/@ionic-native/core
npm ERR!   peer @ionic-native/core@"^4.11.0" from @ionic-native/social-sharing@4.20.0
npm ERR!   node_modules/@ionic-native/social-sharing
npm ERR!     @ionic-native/social-sharing@"^4.20.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: rxjs@5.5.12
npm ERR! node_modules/rxjs
npm ERR!   peer rxjs@"^5.5.11" from @ionic-native/core@4.20.0
npm ERR!   node_modules/@ionic-native/core
npm ERR!     peer @ionic-native/core@"^4.11.0" from @ionic-native/social-sharing@4.20.0
npm ERR!     node_modules/@ionic-native/social-sharing
npm ERR!       @ionic-native/social-sharing@"^4.20.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
bksxznpy

bksxznpy1#

删除node_modules文件夹并重做
国家预防机制一
然后使用以下命令安装组件:
npm i@离子原生/社交共享

相关问题