1
votes

I'm keep getting this error whenever I try to install any npm package on my windows 10 for android. It shows the package added in android studio and node_modules as well. However when i import the npm package in JS file and run the project the error comes up. With the below instructions :

If you are sure the module exists, try these steps:

  1. Clear watchman watches: watchman watch-del-all
  2. Delete node_modules: rm -rf node_modules and run yarn install
  3. Reset Metro's cache: yarn start --reset-cache
  4. Remove the cache: rm -rf /tmp/metro-*

Does anyone knows what i'm doing wrong? I'm using react-native 0.63.2

1

1 Answers

0
votes

It means the metro bundler does not know there is a new package installed. In that case, turn off the metro bundler and follow the steps you listed above and then npx react-native run-android. Those steps clear the cache and help metro find the new package that was installed.