I try updating my ionic cordova cli when i started getting issues installing the two package, but now ionic have been successfully installed and i have tried installing the
I had faced a similar issue. Running the command prompt as an Administrator solved my issue. Try that option as well if you have not already tried.
try running the command
npm cache clean
first
and then re-install the package by running
npm install -g cordova
For me none of the above solutions worked. Then I tried this, which finally did the job :
npm uninstall -g cordova
npm install -g cordova