I am using a cordova based hybrid mobile app. My app is built using ember@2.13. I need to integrate fcm push-notifications to my app, I'm using phonegap-plugin-push@2.1.2.
I added the package into my package.json.
By doing yarn add fcm-node.
Then I imported it in my controller file, by writing code like =>
import FCM from 'fcm-node';, /
import * as FCM from 'fcm-node';/
also tried var FCM = require('fcm-node');
When I install the app or try to run it on browser, i get an error:
Error: Could not find module `fcm-node` imported from `stock/controllers/notifications`
at missingModule (vendor.js:252)
at findModule (vendor.js:263)
at Module.findDeps (vendor.js:173)
at findModule (vendor.js:267)
at requireModule (vendor.js:29)
at Class._extractDefaultExport (vendor.js:133203)
at Class.resolveOther (vendor.js:132900)
at Class.superWrapper [as resolveOther] (vendor.js:60493)
at Class.resolveController (vendor.js:27961)
at Class.resolve (vendor.js:27811)
And even in my vs-code its highlighted with error
Same issue with the require statement too.
I even tried installing by npm install @types/fcm-node. But still no luck.
I am using a
cordova
based hybrid mobile app. My app is built usingember@2.13
. I need to integrate fcm push-notifications to my app, I'm usingphonegap-plugin-push@2.1.2
.I added the package into my
package.json
. By doingyarn add fcm-node
. Then I imported it in my controller file, by writing code like =>import FCM from 'fcm-node';
, /import * as FCM from 'fcm-node';
/ also triedvar FCM = require('fcm-node');
When I install the app or try to run it on browser, i get an error:
And even in my vs-code its highlighted with error![Screen Shot 2019-05-27 at 1 03 48 PM](https://user-images.githubusercontent.com/26408955/58416364-f7144680-809e-11e9-91d2-00dc265b19d8.png)
Same issue with the require statement too.
I even tried installing by
npm install @types/fcm-node
. But still no luck.Could you please help me resolve this ?