npm run ionic:serve - 'Waiting for connectivity with npm'
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:
- Create a new app with
ionic start issue-app. - Add following piece in the script of the package.json
"ionic": "ionic",
"ionic:serve": "ionic serve",
"ionic:build": "ionic build"
- Execute the following command in command prompt.
npm run ionic:serve - 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:
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
Please see this documentation. By specifying those scripts, you're overriding the build/serve.
remove ionic serve command form package.json
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"
},
Thank you all very much!!