Ionic-cli: Error : No listeners for serve event. Did you install the appropriate plugin?

Created on 13 Apr 2017  路  16Comments  路  Source: ionic-team/ionic-cli

Hello,

Short description of the problem:

It was running well before to update CLI.

When I launch Ionic Serve i get the following error message:
[ERROR] No listeners for serve event. Did you install the appropriate plugin?

Steps to reproduce:

  1. npm install -g ionic@beta
  2. npm install --save-dev @ionic/cli-build-ionic-angular@beta @ionic/cli-plugin-cordova@beta
  3. ionic serve

What version of the CLI are you using? Output of ionic --version

Cordova CLI: 6.5.0 
Ionic Framework Version: 3.0.1
Ionic CLI Version: 3.0.0-beta7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: OS X El Capitan
Node Version: v7.9.0
Xcode version: Xcode 8.1 Build version 8B62

Thanks to all

Most helpful comment

$ npm uninstall @ionic/cli-plugin-core @ionic/cli-build-ionic-angular

$ npm install --save-dev @ionic/cli-plugin-cordova@beta @ionic/cli-plugin-ionic-angular

All 16 comments

I get the same error on Windows:

Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 3.0.0-beta7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 8.1
Node Version: v6.10.2
Xcode version: Not installed

After installing @ionic/cli-plugin-cordova@beta, I got this message:

npm install @ionic/cli-plugin-cordova@beta

> @ionic/[email protected] postinstall ...\node_modules\@ionic\cli-plugin-cordova
> node ./bin/postinstall

You will need to install the following global dependencies in order to use this plugin.
npm install -g ios-deploy ios-sim

I am not sure if it is a warning or an error. But in any case, I cannot install it on Windows.

Installed the Ionic 3 beta version in my Windows and followed the steps in their web site executing this in my Ionic 1 project folder:
npm install --save-dev @ionic/cli-build-ionic1@beta @ionic/cli-plugin-cordova@beta

Now I get the same error:
[ERROR] No listeners for serve event. Did you install the appropriate plugin?

Yup, getting the same error here.

As a temporary workaround, you can use npm run ionic:serve instead of ionic serve.

I was just having the same issue and I noticed I was not inside the project folder... The cli hasn't move to the new project folder just created with ionic start.

So try I classic cd ProjectFolder and run ionic serve again

The error occurs to me when I'm within the project folder. It's an existing project with a beta CLI update.

For me it was a new project with the new cli. I just moved to the directory and perform ionic serve and it works.

Then there is a new config file. We must know that config file to add it to our old projects.

$ npm uninstall @ionic/cli-plugin-core @ionic/cli-build-ionic-angular

$ npm install --save-dev @ionic/cli-plugin-cordova@beta @ionic/cli-plugin-ionic-angular

It seems that just doing the following is not enough:

npm install -g ionic@beta
npm install --save-dev @ionic/cli-build-ionic-angular@beta @ionic/cli-plugin-cordova@beta
ionic serve

This works for me:

npm install -g ionic@beta
npm uninstall @ionic/cli-plugin-core @ionic/cli-build-ionic-angular
npm install --save-dev @ionic/cli-plugin-ionic-angular @ionic/cli-plugin-cordova@beta
ionic serve

And how it would be for Ionic 1 apps??

@danielehrhardt solution did NOT work for me. I'm using the updated CLI with an existing Ionic2/Angular v2.2.1 project. @jsayol solution DID work

Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 3.0.0-beta7
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.9.1
Xcode version: Xcode 8.3.1 Build version 8E1000a

I had to uninstall all my Ionic environment and install again using the recommended commands:

$ npm install -g ionic@beta
$ npm install --save-dev @ionic/cli-plugin-ionic1@beta @ionic/cli-plugin-cordova@beta

After that , ensure that in your package, in the devDependencies section has, at least, the following:

"devDependencies": {
    "@ionic/app-scripts": "1.3.0",
    "typescript": "~2.2.1",
    "@ionic/cli-plugin-cordova": "0.0.12",
    "@ionic/cli-plugin-ionic-angular": "0.0.6"
  },

In my case, even an @ionic/cli-plugin-ionic1 have appeared to me - which was very odd. If you keep this, you'll end up getting a ''multiple listeners for serve event". And is not over.
To finally work serve and build, I had to update to Ionic 3.

I hope that helps.

Oh, here my ionic info:

Cordova CLI: 6.5.0
    Ionic Framework Version: 3.0.1
    Ionic CLI Version: 3.0.0-beta7
    ios-deploy version: 1.8.6
    ios-sim version: 5.0.8
    OS: macOS Sierra
    Node Version: v6.9.4
    Xcode version: Xcode 8.3.1 Build version 8E1000a

Updating an existing ionic v2 project via the command:
"npm install --save-dev @ionic/cli-plugin-ionic1@beta @ionic/cli-plugin-cordova@beta"
worked for me and fixed the no listeners for serve event error , thanks @matheuscas

@jsayol Works Perfectly, but the ionic serve CLI are gone ?

@romandahidayat, if you've updated to 3.0.0-beta8, re-run the following:
npm install --save-dev @ionic/cli-plugin-ionic-angular@beta @ionic/cli-plugin-cordova@beta
as listed at http://blog.ionic.io/ionic-cli-v3-beta/.

ionic serve stopped working for me this morning after the beta8 update and installing the newer dev dependencies brought it back.

@vkniazeu yes, i was installed new dependencies and successfully run cli like ionic serve, ionic build ect, thanks for suggession

Was this page helpful?
0 / 5 - 0 ratings