Search code examples
macosshellreact-nativesudo

How Can I Solve Permission Denied in React Native Project?


anyone faced this issue after a run

react-native run-android/ios

android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java (Permission denied)

when i write sudo before any command like npm install/yarn add etc it's work very well

otherways i got errors related to Permission


Solution

    • You might check the permissions on android/gradlew

    • They should be 755 not 644

    • Run chmod 755 android/gradlew inside your app root folder then run react-native run-android

    • And it should work again

    • Finally remove the node modules and re-install using rm -rf node_modules && npm install