0
votes

I am very new to Ionic 2 and have been breaking my head into trying out native Facebook login authentication, I have tried few approaches below, and got no where !

  • When I tried import {Facebook} from 'ionic-native'; I get the "Cannot find module "ionic-native"" error, however I can access the login method by using this Facebook.login(['email']) in my code.

  • When I tired import {Facebook} from '@ionic-native/facebook'; [I have this installed using npm install @ionic-native/facebook --latest --save] , I am unable to access the login method and I get this error Typescript Error Property 'login' does not exist on type 'typeof Facebook'.

Can some one please direct me to a correct approach ??.

Pasted the error log below.

Runtime Error Cannot find module "ionic-native" Stack

Error: Cannot find module "ionic-native" at Object. (//localhost:8100/build/main.js:55660:7) at webpack_require (//localhost:8100/build/main.js:20:30) at Object. (//localhost:8100/build/main.js:74450:77) at webpack_require (//localhost:8100/build/main.js:20:30) at Object. (//localhost:8100/build/main.js:74188:73) at webpack_require (//localhost:8100/build/main.js:20:30) at Object. (//localhost:8100/build/main.js:111876:70) at webpack_require (//localhost:8100/build/main.js:20:30) at //localhost:8100/build/main.js:66:18 at //localhost:8100/build/main.js:69:10

Ionic Framework: 3.2.1 Ionic Native: ^3.5.0 Ionic App Scripts: 1.3.7 Angular Core: 4.1.0 Angular Compiler CLI: 4.1.0 Node: 6.10.2 OS Platform: Windows 10 Navigator Platform: Win32 User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

1
Try npm install --save [email protected] the ionic-native 3.5.0 works differently with each npm module for each plugin & @ionic-native/core. Look up docs - misha130
Hey thanks a ton... that works!! I used import {Facebook} from 'ionic-native' and the 2.5.1 version. - Arun-

1 Answers

1
votes