11
The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false

Body: {"message":"Unable to resolve module events from /Users/mohitverma/Desktop/Projects/Android Apps/easyread/node_modules/node-metainspector/index.js: Module does not exist in the module map or in these directories:\n /Users/mohitverma/Desktop/Projects/Android Apps/easyread/node_modules/node-metainspector/node_modules\n, /Users/mohitverma/Desktop/Projects/Android Apps/easyread/node_modules\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.","name":"UnableToResolveError","type":"UnableToResolveError","errors":[{}]} onResponse DevServerHelper.java:323 execute RealCall.java:126 run NamedRunnable.java:32 runWorker ThreadPoolExecutor.java:1112 run ThreadPoolExecutor.java:587 run Thread.java:818

import React, {Component} from 'react';
import {AppRegistry, StyleSheet, Text, View, Alert} from 'react-  native';
var Extractor = require('node-metainspector');
import axios from 'axios';

const msgTitle = 'Server error';
const msgDescription = 'Could not get data from website';

 export default class Web extends Component {

 constructor(props) {
    super(props);
    this.state = {
        siteDetail: {}
    };
}

componentDidMount() {
    axios(this.props.url).then((webResponse) => {
        //const siteDetail = Extractor(webResponse);
        //this.setState({siteDetail});
        Alert.alert(msgTitle, webResponse.toString());
    }).catch((err) => {
        Alert.alert(msgTitle, msgDescription);
    });
}

render() {
    const self = this;

    return (
        <View style={styles.container}>
            <Text style={styles.welcome}>
                {self.state.siteDetail.title}
            </Text>
        </View>
    );
 }
}
2
  • show your node.js code Commented Jan 7, 2017 at 16:56
  • few external libraries not getting resolved in react-native Commented Jan 7, 2017 at 17:02

1 Answer 1

27

I had the same issue and found a similar github issue.

Following the advice, I had installed the dependency with: npm install events --save and this has resolved my issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.