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 trial

JavaScript Introduction to React Native Implementing React Native Scenes and Routing

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Error 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.

index.android.js
/**
 * 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 :)

Seth Kroger
Seth Kroger
56,413 Points

Your 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.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

I'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
Jonathan Grieve
Treehouse Moderator 91,252 Points

I'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?