Я создаю приложение, используя ионную версию 4, используя Angular 6!Мне нужно получить ориентацию, если устройство, поэтому я использовал плагин ориентации экрана из Ionic 4 документа: [https://beta.ionicframework.com/docs/native/screen-orientation]
Но когда я установил плагин, я получил предупреждения как:
.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/ng-toolkit@1.0.8 requires a peer of @angular-devkit/build-angular@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/ng-toolkit@1.0.8 requires a peer of @angular-devkit/core@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/ng-toolkit@1.0.8 requires a peer of @angular-devkit/schematics@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/schematics-angular@1.0.6 requires a peer of @angular-devkit/core@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/schematics-angular@1.0.6 requires a peer of @angular-devkit/schematics@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/screen-orientation@4.12.2 requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/screen-orientation@4.12.2 requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
+ @ionic-native/screen-orientation@4.12.2
added 1 package in 8.608s
Теперь, когда я попытался импортировать на страницу, например:
Не удалось скомпилировать.
./node_modules/@ionic-native/screen-orientation/index.js Модуль не найден:Ошибка: невозможно разрешить 'rxjs / Observable' в '/ Users / karthikcp / Documents / IONIC / testbake / node_modules / @ ionic-native / screen-ориентации'
Как я могу решить эту проблему?
Информация:
```
Ionic:
ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.7
@angular-devkit/core : 0.7.5
@angular-devkit/schematics : 0.7.5
@angular/cli : 6.1.5
@ionic/ng-toolkit : 1.0.8
@ionic/schematics-angular : 1.0.6
Cordova:
cordova (Cordova CLI) : 7.1.0
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (2 plugins total)
System:
ios-deploy : 1.9.2
NodeJS : v8.11.3 (/Users/karthikcp/.nvm/versions/node/v8.11.3/bin/node)
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000
Обновление
Я переустановил плагин как: npm install --save @ionic-native/screen-orientation@5.0.0-beta.15
Теперь я получаю эту ошибку:
ОШИБКА в src / app / pages / test / test.page.ts (14,42): ошибка TS2304: не удается найти имя 'ScreenOrientation'.
Зависимости:
"dependencies": {
"@angular/common": "~6.1.1",
"@angular/core": "~6.1.1",
"@angular/forms": "~6.1.1",
"@angular/http": "~6.1.1",
"@angular/platform-browser": "~6.1.1",
"@angular/platform-browser-dynamic": "~6.1.1",
"@angular/router": "~6.1.1",
"@ionic-native/core": "5.0.0-beta.15",
"@ionic-native/screen-orientation": "^5.0.0-beta.15",
"@ionic-native/splash-screen": "5.0.0-beta.15",
"@ionic-native/status-bar": "5.0.0-beta.15",
"@ionic/angular": "4.0.0-beta.7",
"cordova-plugin-screen-orientation": "^3.0.1",
"core-js": "^2.5.3",
"rxjs": "6.2.2",
"zone.js": "^0.8.26"
},