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

react native 0.57 cannot resolve module "@babel/plugin-external-helpers" #21214

Closed
HsuWai opened this issue Sep 20, 2018 · 22 comments
Closed

react native 0.57 cannot resolve module "@babel/plugin-external-helpers" #21214

HsuWai opened this issue Sep 20, 2018 · 22 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@HsuWai
Copy link

HsuWai commented Sep 20, 2018

Description

  • Build android is completed successfully, but, got error in node packager.

capture

Issue can be reproduced like this:

react-native init MyApp
cd MyApp
react-native run-android

@fangcaiwen
Copy link

ios也一样的问题

@gutomarzagao
Copy link

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

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. 📋No Template labels Sep 20, 2018
@HsuWai
Copy link
Author

HsuWai commented Sep 20, 2018

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

@sunnylqm
Copy link
Contributor

sunnylqm commented Sep 20, 2018

Seems related to this facebook/metro#198

@sopranolinist
Copy link

sopranolinist commented Sep 20, 2018

npm install --save-dev @babel/plugin-external-helpers does not work for me.
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 51.67 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.10.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Android Studio: 1.1.0 AI-135.1740770
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.0 => 0.57.0
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

@HsuWai
Copy link
Author

HsuWai commented Sep 20, 2018

@sopranolinist After installing it, what's the error shown?

@sopranolinist
Copy link

@HsuWai same error as before adding the babel plugin package: Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(/Users/myMac/Desktop/Coding/react-native-redux-test/testApp/index.js: Cannot find module '@babel/plugin-external-helpers' (null))

@HsuWai
Copy link
Author

HsuWai commented Sep 20, 2018

Ok.. If so, I think you should take a look and try like what @sunnylqm said.

@sunnylqm
Copy link
Contributor

Remember to restart packager after installing any package. My link above does not provide any direct fix, just for reference.

@hqwlkj
Copy link

hqwlkj commented Sep 20, 2018

@sunnylqm So, is there a way to solve this problem?

@sunnylqm
Copy link
Contributor

@hqwlkj npm install --save-dev @babel/plugin-external-helpers and Remember to restart packager after installing any package.

@sopranolinist
Copy link

sopranolinist commented Sep 20, 2018 via email

@git-Asir
Copy link

@HsuWai what the @babel/plugin-external-helpers version are you install,i install 7.0.0,then show another error

@git-Asir
Copy link

after install shown :: Cannot find module 'metro-react-native-babel-preset/src/configs/hmr'
could you printf your package.json

@sunnylqm
Copy link
Contributor

@git-Asir Are you upgrading to 0.57? Make sure you have followed the steps here https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#updating-to-this-version

@fangcaiwen
Copy link

安装后显示::无法找到模块'metro-react-native-babel-preset / src / configs / hmr'
你可以打印你的package.json

The same to you

@yooouuri
Copy link

Installing @babel/plugin-external-helpers fixed it for me!

@pjamessteven
Copy link

pjamessteven commented Sep 20, 2018

This is happening to me too and installing @babel/plugin-external-helpers doesn't help. I'm on a Mac. This happened with my main project, and then I created a new test project from scratch and it happened with that as well.

@HsuWai
Copy link
Author

HsuWai commented Sep 20, 2018

@git-Asir my @babel/plugin-external-helpers version is also 7.0.0.
This is my package.json
capture2

@grabbou
Copy link
Contributor

grabbou commented Sep 20, 2018

We are working on a fix with Metro team. Here's explanation from the issue I've opened today: #21219 (comment)

@grabbou grabbou reopened this Sep 20, 2018
@facebook facebook deleted a comment from react-native-bot Sep 20, 2018
@satya164
Copy link
Contributor

Fixed in facebook/metro@48fa696

@sumitrajora
Copy link

For me it was coming because of mismatch in the versions of the dependencies.
Worked when I matched versions in package.json and run npm install in the project directory.

"dependencies": {
"@babel/runtime": "7.0.0",
"react": "16.6.3",
"react-native": "^0.57.8"
},
"devDependencies": {
"babel-jest": "23.6.0",
"metro-react-native-babel-preset": "^0.45.0",
"jest": "23.6.0",
"react-test-renderer": "16.5",
"schedule": "^0.4.0"
},
"jest": {
"preset": "react-native"
}

@facebook facebook locked as resolved and limited conversation to collaborators Sep 20, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests