Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJonathan Grieve
Treehouse Moderator 91,253 PointsError in React Native: cli.js returns the following
Bundling `index.android.js` [development, non-minified, hmr disabled] 96.1% (296/302), failed.
error: bundling failed: "Unable to resolve module `react-native-router-flux` from `C:\\xampp\\htdocs\\reactProject\\src\\App.js`: Module does not exist in the module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: `watchman watch-del-all`.\n 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n 3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`."
I'm using Android to develop the app and I'm having some trouble.
I don't think react-native-router-flux
has been installed properly but I can only assume I've done this right as the instructions for Android were not included (nor were they on the iOS file for that matter.
Watchman commands don't work in Git Bash.
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import App from './src/App.js'
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('reactProject', () => App);
Link to Repo Now out of date*
Thanks :)
Jonathan Grieve
Treehouse Moderator 91,253 PointsI'll have to try this tomorrow. It's close for play in England right now :)
I can say I've already tried deleting the node modules folder and reinstalling but the same result.
The watchman command isn't recognised at all; I'm not even sure what that does. I guess I'll have to be more brave and try the other commands and let you know :)
Incidentally do you always have to open a particular Android Studio project to open the emulator when running a RN project?
Jonathan Grieve
Treehouse Moderator 91,253 PointsI've opened the link to the repo if you did want to take a closer look.
I've updated the repo, but do you think I'm maybe just better off getting a fresh copy of the downloads and starting over?
Seth Kroger
56,413 PointsSeth Kroger
56,413 PointsYour repo is private, BTW.
Looks like an issue that bites people at random. Sorry about that. I'd still try removing the node_modules directory reset the npm cache and re-installing. Note if there are any errors.