Neo
Neo

Reputation: 4880

ionic missing script: ionic:build

I am trying to build an ionic app, however when I run npm run ionic:build -–prod, I get the following error:

npm run ionic:build -–prod
npm ERR! Darwin 17.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ionic:build" "-–prod"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10

npm ERR! missing script: ionic:build
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

Using the following versions:

ionic (Ionic CLI)  : 4.1.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework    : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Quick search suggested running npm install @ionic/app-scripts@latest --save-dev which I did, however that did not solve the issue. What am I missing?

Upvotes: 3

Views: 7493

Answers (2)

Anju Batta
Anju Batta

Reputation: 104

Update the project's package.json file script section like this:

"scripts" : { 
"ionic:build": "ionic-app-scripts build",  
"ionic:serve": "ionic-app-scripts serve" 
}

Upvotes: 3

Dean Foulds
Dean Foulds

Reputation: 33

I started my Ionic 4 app from a blank starter and the scripts to run are in the Ionic json.

If you npm run build, should work for you.

Upvotes: 3

Related Questions