Ionic 'platform add' give an error

I’ve been working on my app for a while. I removed the platforms directory and was trying to add ‘ios’ back to the app. The command line is giving me an error now:

Updated the hooks directory to have execute permissions
Running command: /Users/RickAtWork/workspaces/dim/dim-mobile-client/hooks/before_platform_add/init_directories.js /Users/RickAtWork/workspaces/dim/dim-mobile-client
Adding ios project…
Error: Cannot read property ‘replace’ of undefined

Can anyone give me a pointer on how I can debug this and resolve the issue? I am experiencing it and another developer is as well. I wrote them off as an outlier but a few days later, I’m experiencing it.

Thanks in advance for the help with this.
Rick

So this link,

gave me a tip to debug…

Running “cordova -d platform add android” yields a little bit more info.

Doing so showed me that I was missing a package name, which lead me to the config.xml file and a missing ID on the widget element. Huzzah.