Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find module babel-preset-react-native #431

Open
mrishan1993 opened this issue Jul 3, 2019 · 4 comments
Open

cannot find module babel-preset-react-native #431

mrishan1993 opened this issue Jul 3, 2019 · 4 comments

Comments

@mrishan1993
Copy link

I upgraded RN to 0.59 and installed metro-react-native-babel-preset latest version.
While running react-native run-android, I get the error "Cannot find module babel-preset-react-native". I also changed the config file .babelrc

Package.json

  "name": "ReactNativeBoilerplate",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "@ant-design/react-native": "^3.1.5",
    "ajv": "^5.5.2",
    "axios": "^0.18.0",
    "feather-icons-react": "^0.3.1",
    "moment": "^2.24.0",
    "react": "^16.2.0",
    "react-native": "^0.59.0",
    "react-native-carousel-view": "^0.5.1",
    "react-native-fbsdk": "^0.8.0",
    "react-native-fontawesome": "^6.0.1",
    "react-native-icons": "^0.7.1",
    "react-native-image-zoom-viewer": "^2.2.25",
    "react-native-loader": "^1.2.1",
    "react-native-parallax-swiper": "^1.1.7",
    "react-native-share": "^1.2.1",
    "react-native-tab-view": "github:react-navigation/react-native-tab-view",
    "react-native-vector-icons": "^6.4.2",
    "react-navigation": "^1.5.1",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0",
    "rn-fetch-blob": "^0.10.15"
  },
  "devDependencies": {
    "babel-eslint": "^8.2.2",
    "babel-jest": "^22.4.1",
    "eslint": "^4.18.2",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-friendly-formatter": "^3.0.0",
    "eslint-plugin-import": "^2.9.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.7.0",
    "jest": "^22.4.2",
    "metro-react-native-babel-preset": "^0.54.1",
    "react-test-renderer": "^16.2.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

.babelrc
{ "presets": ["module:metro-react-native-babel-preset"] }

WhatsApp Image 2019-07-03 at 3 24 38 PM

@Shanie1331
Copy link

+1

1 similar comment
@syJSdev
Copy link

syJSdev commented Nov 5, 2019

+1

@fabiancarlos
Copy link

remove .babelrc, create the file babel.config with the code below, then npm install on root, then remove the build folder on ios/, and try build again.

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
};

@Krishnakumarskr
Copy link

Krishnakumarskr commented Aug 17, 2021

remove .babelrc, create the file babel.config with the code below, then npm install on root, then remove the build folder on ios/, and try build again.

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
};

After doing this I am getting the following error

error: index.js: [BABEL] D:\project\index.js: Cannot find module '@babel/helper-builder-binary-assignment-operator-visitor'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants