Ionic 4 ios build "You cannot run cocoapods as root"

Hi all,

I’m facing an issue callled “You cannot run cocoapods as root” when I’m trying to build ionic ios .

can someone please help me with this?

Does the problem persist if you refrain from building as root (this includes not using sudo)?

yes it happens when I run

sudo ionic cordova build ios


I have solve my issue changing permissions ( by changing permission in get info )

you mean which folder permission? I’m getting same error while installing firebasex plugin

Permission of folder ‘ios’ in platforms/ios. Try unlocking it and then click settings icon and then select ‘Apply to enclosed item’. Then open terminal and navigate to platforms/ios/ and then type pod install.
Please note, that this is just a workaround. As @rapropos pointed already above, it is not recommended to build as root user. Try using nvm instead.