ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

npm run ionic:serve - 'Waiting for connectivity with npm'

Open AntonyJos opened this issue 6 years ago • 4 comments

Description:

On trying to serve the application with npm, the application fails to serve with multiple errors stating 'Waiting for connectivity with npm'.

Steps to Reproduce:

  1. Create a new app with ionic start issue-app.
  2. Add following piece in the script of the package.json
    "ionic": "ionic",
    "ionic:serve": "ionic serve",
    "ionic:build": "ionic build"
  1. Execute the following command in command prompt. npm run ionic:serve
  2. Observe if the application serves at the port 8100.

The Application fails to serve in loaclhost:8100, ideally application should have served without any exception and redundant commands to ionic serve

Output:

cli issue

My ionic info:

Ionic:

   Ionic CLI                     : 5.4.9
   Ionic Framework               : @ionic/angular 4.7.1
   @angular-devkit/build-angular : 0.801.2
   @angular-devkit/schematics    : 8.3.8
   @angular/cli                  : 8.3.17
   @ionic/angular-toolkit        : 2.1.1

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (0 plugins total)

Utility:

   cordova-res : 0.8.1
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (C:\Apps\sdk)
   NodeJS            : v10.16.3 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 10

Other Information:

In ionic 3, the same was done with the help ionic-app-scripts like

    "ionic:serve": "ionic-app-scripts serve"
    "ionic:build": "ionic-app-scripts build"

but in ionic 4, the expectation would be to do the same with

    "ionic:serve": "ionic serve",
    "ionic:build": "ionic build"

like how Angular does with ng

AntonyJos avatar Dec 18 '19 15:12 AntonyJos

Please see this documentation. By specifying those scripts, you're overriding the build/serve.

imhoffd avatar Dec 18 '19 16:12 imhoffd

remove ionic serve command form package.json

sachinshera avatar Jul 30 '22 22:07 sachinshera

ionic 7 also same, after add capacitor, package.json updated and make this warning. then remove ionic serve command form package.json

  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "lint": "ng lint"
  },

thusithawijethunga avatar Jun 27 '23 18:06 thusithawijethunga

Thank you all very much!!

ifelere avatar Oct 10 '23 20:10 ifelere