1
votes

I created a new app of react native as explained into new documentation of react native 0.61 they mentioned that to remove react-native CLI because it is creating issues....see below image: image from react-native documentation 0.61




But now I'm trying to add async storage from yarn add @react-native-community/async-storage And this is giving me an error. it is not adding to my project.

I'm not getting any error in installing package but it is not adding in package.json file I also tried to add native-base then I ran react-native link that aslo not added to package.json and it also gave me error:

  • warn Package @react-native-community/async-storage has been ignored because it contains invalid configuration. Reason: Cannot find module '@react-native-community/async-storage/package.json'

  • error EACCES: permission denied, scandir '/home/ajay/project/newEON/android/app/build/generated/not_namespaced_r_class_sources/debug/r/com'. Run CLI with --verbose flag for more details.

Screenshot of error

1
What is the error that you are getting ? - stud3nt
Does it occurs with another dependency? What is the error? - Ian Vasco
Can you post error logs here, it will be easy to get to the answer. - Ratnadeep Bhattacharyya
I'm not getting any error in installing package but it is not adding in package.json file I also tried to add native-base then I ran react-native link that aslo not added to package.json and it also gave me error: warn Package @react-native-community/async-storage has been ignored because it contains invalid configuration. Reason: Cannot find module '@react-native-community/async-storage/package.json' error EACCES: permission denied, scandir '/home/ajay/project/newEON/android/app/build/generated/not_namespaced_r_class_sources/debug/r/com'. Run CLI with --verbose flag for more details. - Ajay Sharma
Possibly duplicate: Check yarn error eaccess permission denied or here - awran5

1 Answers

1
votes

I'll assume that your project folder path is /home/ajay/project/newEON/

1. First thing please run permission check:

Go inside your project folder if you're not already and run:

ls -l

You should see something like:

drwxr-xr-x 1 YourUser [size] [date] node_modules
-rw-r--r-- 1 YourUser [size] [date] package.json

If not, run:

sudo chmod -R 755 home/ajay/project/newEON/

Learn more about permission here | here

2. Try to remove the build folder inside newEON/android

// Make sure you are inside your project
rm -R android/app/build

3. Try to remove node_modules and yarn.lock

// Make sure you are inside your project
rm -R node_modules && rm yarn.lock

Finally make sure you have yarn v1.xx yarn -v, yarn v2 is very different from the v1.

// Run after removing node_modules && rm yarn.lock
yarn