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 './bundle/unbundle' after react-native-git-upgrade. #23197

Closed
motogod opened this Issue Jan 29, 2019 · 11 comments

Comments

Projects
None yet
6 participants
@motogod
Copy link

motogod commented Jan 29, 2019

Environment

System:
OS: macOS 10.14.2
CPU: (4) x64 Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz
Memory: 448.52 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.6.0 - ~/.nvm/versions/node/v11.6.0/bin/node
npm: 6.7.0 - ~/.nvm/versions/node/v11.6.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 26, 27, 28
Build Tools: 27.0.3, 28.0.3
System Images: android-24 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8
npmGlobalPackages:
react-native-git-upgrade: 0.2.7

Description
step 1.
Create a new project with RN version 0.57.8.
step 2.
rename .babelrc to other name (.abelrc)
step 3.
react-native-git-upgrade
step 4.
react-native run-ios

then terminal print the message:

internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module './bundle/unbundle'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/morton.hsu/ReactNativeProject/testup/node_modules/react-native/local-cli/commands.js:44:1)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Module._compile (/Users/morton.hsu/ReactNativeProject/testup/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Object.newLoader (/Users/morton.hsu/ReactNativeProject/testup/node_modules/pirates/lib/index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:620:32)
mortonde-Mini:testup morton.hsu$ react-native info
internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module './bundle/unbundle'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/morton.hsu/ReactNativeProject/testup/node_modules/react-native/local-cli/commands.js:44:1)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Module._compile (/Users/morton.hsu/ReactNativeProject/testup/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Object.newLoader (/Users/morton.hsu/ReactNativeProject/testup/node_modules/pirates/lib/index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:620:32)

If I just create a new project with 0.58.3 or 0.57.8 is working.

But use react-native-git-upgrade from 0.57.8 to 0.58.3 and run the project get the error.

Any idea ? Thanks in advance.

@react-native-bot

This comment has been minimized.

Copy link
Collaborator

react-native-bot commented Jan 29, 2019

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@react-native-bot

This comment has been minimized.

Copy link
Collaborator

react-native-bot commented Jan 29, 2019

We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on Stack Overflow, or on Reactiflux. You may also use discuss.reactjs.org/ to discuss best practices.

@m4rcoperuano

This comment has been minimized.

Copy link

m4rcoperuano commented Jan 30, 2019

I've run into this same exact issue and I can't find anything on SO @react-native-bot

@m4rcoperuano

This comment has been minimized.

Copy link

m4rcoperuano commented Jan 30, 2019

@motogod did you find a way to resolve this issue?

@motogod

This comment has been minimized.

Copy link
Author

motogod commented Jan 30, 2019

@m4rcoperuano I have asked the same question on stack overflow, Akio give me a solution. https://stackoverflow.com/questions/54414518/react-native-git-upgrade-error-cannot-find-module-accessibilityinfo

I'm not try the solution yet. I think you can try it.

If it is working or not, let me know it. Thanks.

@m4rcoperuano

This comment has been minimized.

Copy link

m4rcoperuano commented Jan 30, 2019

@motogod So i didn't try what he mentioned, but it gave me a good hint! I never want to mess with anything labeled cache, so I ended up removing my node_modules folder. Recreating it, empty, and running npm install to rebuild all my modules. Thats it. My react-native commands started working again. I guess during my react-native-git-upgrade, my node_modules got out of sync? I'm not sure.... but this worked for me without having to touch any cached files :)

@m4rcoperuano

This comment has been minimized.

Copy link

m4rcoperuano commented Jan 30, 2019

Thank you so much for that stack overflow post @motogod. Def led me to solve this. Hope clearing our the node_modules folder works for you too

@DMCHZP

This comment has been minimized.

Copy link

DMCHZP commented Jan 31, 2019

@motogod it work!

@motogod

This comment has been minimized.

Copy link
Author

motogod commented Jan 31, 2019

@m4rcoperuano @DMCHZP Hppy to heard that ! Thanks Akio.

@jenish2311

This comment has been minimized.

Copy link

jenish2311 commented Feb 19, 2019

You can try

rm -r ./node_modules
//For if you are not admin user
sudo npm cache clean --force
//if admin user no need to use sudo just
npm cache clean --force
then
npm i

This is worked for me

@karltaylor

This comment has been minimized.

Copy link

karltaylor commented Mar 10, 2019

$ rm -rf node_modules && npm i

Can confirm removing node_modules and re-installing worked ok for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.