This happened to me when I upgraded from Ionic 3 to 4. The problem is that package.json
and ionic.config.json
both changed from 3 to 4. So when you do your copy-paste actions you have to be careful.
Ionic.config.json type should be angular
(used to be "type": "ionic-angular")
{
"name": "myProjectName",
"integrations": {
"cordova": {}
},
"type": "angular"
}
package.json scripts now follow angular style
You may have had something like this
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint --bailOnLintError true",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"ionic:watch:before": "node ./bin/pre-build.js",
"ionic:build:before": "node ./bin/pre-build.js"
},
That should now changed to standard angular in Ionic 4:
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},