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

[Unable to resolve module & ENOENT: no such file or directory #5054

Closed
shawnXiao opened this issue Dec 31, 2015 · 14 comments
Closed

[Unable to resolve module & ENOENT: no such file or directory #5054

shawnXiao opened this issue Dec 31, 2015 · 14 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@shawnXiao
Copy link

Hi

I want to upgrade my React Native from 0.13.2 to 0.17, so as the instruction https://facebook.github.io/react-native/docs/upgrading.html#content
npm install --save react-native@0.17 and then react-native upgrade
But when I run my project, the terminal say this:

Unable to resolve module requestAnimationFrame from /Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/Libraries/Animated/src/AnimatedImplementation.js
Unable to resolve module keyMirror from /Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/Libraries/Components/WebView/WebView.ios.js
Unable to resolve module ReactPropTypes from /Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/Libraries/Inspector/ElementProperties.js
Unable to resolve module ReactDefaultPerf from /Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/Libraries/Utilities/RCTRenderingPerf.js
Unable to resolve module ReactPropTypes from /Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/Libraries/CameraRoll/CameraRoll.js
...
...
...
Unable to resolve module ReactPropTypes from /Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js
Unable to resolve module keyMirror from /Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js
[00:46:03] find dependencies (494ms)
[00:46:03] transform
transforming [======== ] 21% 65/311Error: ENOENT: no such file or directory, open '/Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/packager/react-packager/src/DependencyResolver/polyfills/prelude_dev.js'
at Error (native)
transforming [======================================= ] 98% 304/311[10:17:56] request:/index.ios.bundle?platform=ios&dev=true
Error: ENOENT: no such file or directory, open '/Users/xiong/Documents/meituan/frontend/bee/node_modules/react-native/packager/react-packager/src/DependencyResolver/polyfills/prelude_dev.js'
at Error (native)

@facebook-github-bot
Copy link
Contributor

Hey shawnXiao, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!

@brentvatne
Copy link
Collaborator

Hi there! A good thing to try in this case is rm -rf node_modules and then run npm install again from scratch. If this doesn't work for you, try out StackOverflow or Discord as @facebook-github-bot so kindly mentioned above :)

@eremzeit
Copy link
Contributor

It's a cache issue. See: #1924

You need to clear your packager cache: rm -fr $TMPDIR/react-*
Or this appears to do the trick also: watchman watch-del-all

@grigio
Copy link

grigio commented Aug 1, 2016

Fixed again with:

❯ rm -fr $TMPDIR/npm* 
❯ rm -fr $TMPDIR/*.json.gzip

@cri5ti
Copy link

cri5ti commented Aug 8, 2016

If clearing the cache still doesn't work for you, do you have a project rn-cli.config.js defined?
Try without it. (Or make sure you base it on the node-modules/react-native/packager/rn-cli.config).

@jcollum
Copy link

jcollum commented Dec 4, 2016

Tried all the things in this thread.

 5335  rm -rf node_modules/
 5336  npm install 
 5339  rm -fr $TMPDIR/react-*
 5340  watchman watch-del-all
 5341  rm -fr $TMPDIR/npm*
 5342  rm -fr $TMPDIR/*.json.gzip
 5343  cat rn-cli.config.js 
 (no file found) 

Still getting the error: ENOENT: no such file or directory, uv_chdir

@jcollum
Copy link

jcollum commented Dec 5, 2016

Follow up: the source code I checked out did not have an ios folder, causing the start up of the app to fail. I fixed that at the source and it started up fine after pulling new code.

Just a very cryptic error message in this case.

@marktani
Copy link

marktani commented Dec 9, 2016

I have the same situation. My project only has a android folder, but no ios one. Is there a similar command to react-native android that creates a bare iOS project?

How can I create a new iOS project based on the android React Native project that I have?

@jcollum
Copy link

jcollum commented Dec 9, 2016

@marktani I think the answer is "find whoever made the project and get them to add the ios folder into their repo". Barring that, init a new project and copy over the ios folder from it -- but you'll have to edit the files to get them to work with your project, things like the name of the project. Sounds like a hassle. You might be better off initing a new project and copying your work into it.

@marktani
Copy link

marktani commented Dec 9, 2016

Right, thanks for the help! I got it working by doing init as you said.

I am the one who created the project in the first place, but I did so on a Linux machine. I think that's why there was no ios folder being created...

@jcollum
Copy link

jcollum commented Dec 9, 2016

think that's why there was no ios folder being created

That doesn't sound right. I don't have a linux vm handy to test it on though... On second thought I suppose it could be right because XCode won't run on linux. Wow, how lame would that be? Only being able to develop ios apps on a mac, even when using a cross-platform tool like RN?

@julesmoretti
Copy link

react-native upgrade ... took me a while to resolve it :/

@13hoop
Copy link

13hoop commented Jun 11, 2017

@julesmoretti
react-native upgrade worked

thx!

@WhoJave
Copy link

WhoJave commented Jan 22, 2018

react-native upgrade will init your project config !!!

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests