React-native: react native events module not found

Created on 29 Apr 2015  路  5Comments  路  Source: facebook/react-native

I am trying to follow flux example for React, but var EventEmitter = require('events').EventEmitter; can't load events module. Please help.

Thanks.

Locked

Most helpful comment

@iceNuts - alternatively, you could include the events module from npm as I do here

All 5 comments

Call me crazy, but I think you want:

var EventEmitter = require('EventEmitter');

events is a node.js standard library module, @jaygarcia is right - here you would do require('EventEmitter') just like in RCTDeviceEventEmitter

@iceNuts - alternatively, you could include the events module from npm as I do here

events from npm working for react native. Thanks

Do I have to install EventEmitter module? It still does not find it. I tried but still I am having the same error. Maybe knowing at least that I could find some fresh information.

Was this page helpful?
0 / 5 - 0 ratings