1

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

Ajay Sharma
  • 97
  • 4
  • 11
  • 2
    What is the error that you are getting ? – stud3nt Feb 24 '20 at 12:49
  • Does it occurs with another dependency? What is the error? – Ian Vasco Feb 24 '20 at 12:50
  • Can you post error logs here, it will be easy to get to the answer. – Ratnadeep Bhattacharyya Feb 24 '20 at 12:50
  • 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 Feb 24 '20 at 12:57
  • Possibly duplicate: Check [yarn error eaccess permission denied](https://stackoverflow.com/questions/49529696/yarn-error-eaccess-permission-denied-scandir-home-ubuntu-config-yarn-link) or [here](https://stackoverflow.com/questions/38323880/error-eacces-permission-denied) – awran5 Feb 24 '20 at 13:01
  • Check [this](https://stackoverflow.com/questions/60276556/how-can-i-solve-permission-denied-in-react-native-project) – Oliver D Feb 24 '20 at 13:04
  • @awran5 no it's not working – Ajay Sharma Feb 24 '20 at 13:05
  • @AjaySharma Whats your OS? – awran5 Feb 24 '20 at 13:06
  • OS: ubuntu 19.10 – Ajay Sharma Feb 24 '20 at 13:15

1 Answers1

1

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
awran5
  • 4,333
  • 2
  • 15
  • 32