If you're using Ionic Pro and setting up Deploy, make sure you do this before pushing your code.
Followung the Ionic Deploy instructions on their site, doing the initial git push takes ages, sends up all the node_modules files and other gubbins and then fails to build at their end. Their documentation fails to mention you should have a .gitignore file in your project BEFORE doing your initial push.
Add a file called ".gitignore" to your project root (same level as package.json), with the following contents:
*~ *.sw[mnpcod] *.log *.tmp *.tmp.* log.txt *.sublime-project *.sublime-workspace .vscode/ npm-debug.log* .idea/ .sourcemaps/ .sass-cache/ .tmp/ .versions/ coverage/ dist/ node_modules/ tmp/ temp/ hooks/ platforms/ plugins/ plugins/android.json plugins/ios.json www/ $RECYCLE.BIN/ .DS_Store Thumbs.db UserInterfaceState.xcuserstate
Then when you do the git push, it will ignore all those files and should build fine in the cloud.