1

I am having the following error while running the react native code,please help me

error: index.js: Cannot find module 'babel-plugin-r' Require stack:

  • /home/Documents/Assignment3/node_modules/@babel/core/lib/config/files/plugins.js
  • /home/Documents/Assignment3/node_modules/@babel/core/lib/config/files/index.js
  • /home/Documents/Assignment3/node_modules/@babel/core/lib/index.js
  • /home/Documents/Assignment3/node_modules/metro-transform-worker/src/index.js
  • /home/Documents/Assignment3/node_modules/metro/src/DeltaBundler/Worker.js
  • /home/Documents/Assignment3/node_modules/jest-worker/build/workers/processChild.js

1 Answers1

0

I faced the same problem when i used react navigation which requires react-native-reanimated. To resume, after following instructions mentionned in the documentation, i omitted the three points ... , as following:

    module.exports = function (api) {
      api.cache(true);
      return {
        presets: ["babel-preset-expo"],
        //...   <=== this three dots caused the problem
        plugins: ["react-native-reanimated/plugin"],
      };
    };

which resolved the problem for me. Original answer link is here