You now just pushed your Ionic code to a git repository, added it in Netlify with build command
ionic build --prod
and set the publish directory to
only to find out that the build failed.
Based from the error log, Netlify complained that it can’t find the “ionic command” and if you’re new to Ionic, this might be an annoyance to you.
To fix this, we need to add the @ionic/cli as a dependency with this command
npm i -D @ionic/cli
Push your code again and the build should finish successfully.
This article is a reminder for my future self. Ciao