If you have an issue with your cordova or Ionic Framework. It would be best if you can just uninstall the framework and reinstall them again. To uninstall them via NodeJS, you can follow those quick line command in NodeJS command prompt.
To uninstall Cordova, following this command:
npm uninstall -g cordova
To uninstall Ionic framework, following this command:
npm uninstall -g ionic
Once uninstall is complete, you can reinstall the Ionic framework by using the following command line.
npm install -g cordova ionic