Local Notifications not working in Ionic

I implemented Local notifications using plugin https://ionicframework.com/docs/native/local-notifications/ and it works just as expected, but every time I take push my changes and take a pull again, I need to re-install the plugin and build again. Any solutions?

Running ionic info gives following on terminal:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.13.0
ionic (Ionic CLI) : 3.13.0

global packages:

cordova (Cordova CLI) : 7.0.1 

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.2.3 ios 4.5.1
Ionic Framework    : ionic-angular 3.7.0


ios-deploy : 1.9.2 
Node       : v6.11.3
npm        : 3.10.10 
OS         : macOS High Sierra
Xcode      : Xcode 9.0 Build version 9A235 


backend : pro

Hello Kapil,

Just a guess, do you mean a git push and a git pull on a new installation?
If this is the case did you also run

npm install

to download the dependencies?

There is no Cordova information here which is strange. How are you building your app? Did you run ionic info in your app folder?

Not on new installation but on already existing code.

Oops! I guess I missed that, it’s updated in the question now.

What does your config.xml and packages.json look like?

It’s not letting me paste my config.xml file:

It does. You just have to select the text and then hit the </> button so it doesn’t try to render the XML as HTML but shows the plain code.

I got the fix, it was this line in my package.json file that was causing the problem:

"cordova-plugin-app-event": "file:node_modules/cordova-plugin-app-event"

Changing the path of the plugin fixed the issue.
Thanks for helping. :slight_smile:

What did you fix it to?
(In another thread there is literally the same line causing problems I think…)

We have node_modules in our project directory, and it was trying to look for a package.json file inside node_modules/node_modules, so there are 2 things that could be done:

  1. Change that path inside your project’s package.json
  2. a) Copy cordova-plugin-app-event directory from inside of some other plugin (I found it inside Local Notification Plugin which can be found here “https://ionicframework.com/docs/native/local-notifications/”)
    b) Create a directory named node_modules inside already existing node_modules directory of your project.
    c) cd into /node_modules/node_modules
    d) Paste cordova-plugin-app-event directory here.

I have also provided a link to this problem in another question that I asked some time back.
Here is it: “Could not install ‘node_modules/cordova-plugin-app-event’