I am having issues installing Cordova and Ionic. At first I couldn\'t because of what seems to be a corrupted installation, that led me to uni
Let, update the latest version of npm for running this command,
npm install npm@latest -g
Then run this command,
npm install -g cordova ionic
This still happens randomly on some npm versions. Issue got resolved on downgrading to npm version 5.6.0 using command
npm install -g npm@5.6.0
Hope that will help someone.
It happened to me when I tried to install a ionic3 project with npm@5.8, well I solved this issue just add some params, use the following:
npm i --unsafe-perm
and it works.
Usually this error is due to your Antivirus blocking access to changing the files, to solve this:
1- You can try to turn your Antivirus off (temporarily) & try the installation again
2- If that alone doesn't work, try using the --force option while installing
I had this issue with some packages & it was solved by using one of the 2 steps above.
For example:
npm install -g cordova ionic --force
In my case, I didn't downgrade my npm because it will cause chaos in other dependencies. Instead, I tried running
npm cache verify
Error gone...
Try installing latest npm version this happens a lot with ionic.
npm install -g npm@latest
npm cache verify
npm i
If this doesn't work I advise you to switch to yarn. It's faster & easier to use. This is the link to download YARN.
After installing just run this command yarn global add cordova ionic
Ionic CLI uses npm by default. So go to your project & run $ yarn install
.
If you want Ionic to use yarn by default run this: $ ionic config set -g yarn true