All Articles

Deploying Ionic App in Netlify ( 2020 )

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

www

only to find out that the build failed.

Ionic error log in netlify

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