Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native init (0.57) Cannot find module '@babel/plugin-external-helpers'

Tags:

react-native

When I create a brand new react native project, I get this error message:

Cannot find module '@babel/plugin-external-helpers'

My package.json file:

{
  "name": "TestProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.5.0",
    "react-native": "0.57.0"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.45.4",    
    "react-test-renderer": "16.5.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

Any idea what is wrong?

Thank you.

like image 203
sbkl Avatar asked Sep 19 '18 23:09

sbkl


Video Answer


2 Answers

Same thing for me, just run

npm install --save-dev @babel/plugin-external-helpers

and it should works

like image 94
dimonD Avatar answered Oct 20 '22 02:10

dimonD


just install @babel/plugin-external-helpers, no need to change .babelrc For me, fixed this issue by installing @babel/plugin-external-helpers and react-transform-hmr.

Run:

npm install --save-dev @babel/plugin-external-helpers
npm install react-transform-hmr
like image 25
HSU WAI Avatar answered Oct 20 '22 00:10

HSU WAI