I am creating an ionic app with Ionic 4 based on angular 6!
To set the screen orientation installed the below plugin.
ionic cordova plugin add cordova-plugin-screen-orientation
npm install --save #ionic-native/screen-orientation
And imported in required typescript! But when i run the project i got the error below.
ERROR in node_modules/#ionic-native/screen-orientation/index.d.ts(2,10): error TS2305: Module '"/Users/karthikcp/Documents/IONIC/myBake/node_modules/rxjs/Observable"' has no exported member 'Observable'.
[ng] node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
Can anyone help me in fixing this error?
In Ionic 4 you need to install all your native plugins as beta:
npm install --save #ionic-native/screen-orientation#beta
Inside your code, for Angular, the import path should end with /ngx.
import { ScreenOrientation } from '#ionic-native/screen-orientation/ngx';
Don't install rxjs-compact.
npm i rxjs-compat
Please add these command on your root folder
Related
I created a new ionic 5 project by using
ionic start myApp blank
When I run the project in browser using ionic serve it has given the following error
Error: NGCC failed
I figured out the problem my self
The problem was when I was installing the latest npm packages
it was installing the typescript: 4.0.2 and thats why the NGCC error
occured
run the following command and it will work,
npm i typescript#">=3.9.2 <4.0.0”
Or in future some one faces this error this is about the typescript version so just install the valid typescript and you will fix the ngcc error
while installing auth0 in ionic I'm facing this error.
ionic cordova plugin add #ionic-enterprise/auth-connect --variable AUTH_URL_SCHEME=com.company.app
The package #ionic-enterprise/auth is only available for subscriptors.
See: https://github.com/ionic-team/ionic-cli/issues/4359
I have a issue using ionic on my mac. I've cloned my repo and started it with ionic serve. But if I use control C and stop the command ant start it again I get this error "Cannot read property 'IONIC_CONFIG_DIRECTORY' of undefined".
Same problem here. Found the solution: https://forum.ionicframework.com/t/ionic-commands-not-working-after-update-ionic/146492/3
Solution:
npm uninstall ionic cordova
npm install ionic cordova
Im getting error as after i install datatabel npm install angular-4-data-table --save
ERROR in ./node_modules/angular-4-data-table/src/index.ts
Module build failed: Error: C:\SOFT\Angular\Angular\node_modules\angular-4-data-table\src\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
You are certenly using a higher version of angular which is not well organised with angular-data-table4 then upgrade for 5 version of the grid :
npm install angular5-data-table --save
and in App Module use:
import {DataTableModule} from 'angular5-data-table';
use in component
import { ... } from 'angular5-data-table';
it worked for me
When i tried to add ionic push plugin using
ionic plugin add https://github.com/phonegap-build/PushPlugin.git
i got following error in command promp
Updated the hooks directory to have execute permissions Fetching plugin "https://github.com/phonegap-build/PushPlugin.git" via git clone Repository "https://github.com/phonegap-build/PushPlugin.git" checked out to git ref "master". shell.js: internal error Error: EXDEV, cross-device link not permitted 'C:\Users\A-25\AppData\Local\Temp\git\1438839071751\Example'
at Error (native)
at Object.fs.renameSync (fs.js:636:18)
at C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\mv.js:77:8 at Array.forEach (native)
at Object._mv (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\mv.js:53:11)at Object.mv (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\common.js:186:23)
at C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\util\plugins.js:53:19
at _fulfilled (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
can anybody tell me what's the problem?
i just downgrade my cordova version to 5.0.0 and it works
Without downgrading your cordova version you could try this
ionic plugin add cordova-plugin-push-notification
I had a similar question:
From an official blog post, Cordova is moving their plugins to npm.
I had the same problem with the ionic plugin add ... command that Mudasser mentioned. So, I installed it easily now with npm:
npm install phonegap-plugin-push