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 `assert` `buffer` `events` #21405

Open
JonathanReisCom opened this Issue Sep 28, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@JonathanReisCom
Copy link

JonathanReisCom commented Sep 28, 2018

Environment

React Native Environment Info:
System:
OS: OS X El Capitan 10.11.6
CPU: x64 Intel(R) Core(TM)2 Duo CPU E8335 @ 2.66GHz
Memory: 244.53 MB / 6.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.11.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 10.2, macOS 10.12, tvOS 10.1, watchOS 3.1
Android SDK:
Build Tools: 22.0.1, 25.0.0, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.1, 27.0.3, 28.0.1
API Levels: 23, 24, 26, 27
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 8.2.1/8C1002 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.1 => 0.57.1
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

Description

var EventEmitter = require('events').EventEmitter;
error: bundling failed: Error: Unable to resolve module events from /Users/Jonathan/Desktop/00-React/MyKitchen/Classes/Scenes/MongoDBTest/index.js: Module events does not exist in the Haste module map

var buffer = require('buffer')
error: bundling failed: Error: Unable to resolve module buffer from /Users/Jonathan/Desktop/00-React/MyKitchen/Classes/Scenes/MongoDBTest/index.js: Module buffer does not exist in the Haste module map

var assert = require('assert');
error: bundling failed: Error: Unable to resolve module assert from /Users/Jonathan/Desktop/00-React/MyKitchen/Classes/Scenes/MongoDBTest/index.js: Module assert does not exist in the Haste module map

Reproducible Demo

Create a new project:
$ react-native init MyKitchen

add this line in App.js:
var assert = require('assert');

$ react-native run-android

@rajivshah3

This comment has been minimized.

Copy link
Contributor

rajivshah3 commented Oct 25, 2018

These modules are core Node modules, but they are not automatically included in React Native. You might want to look into https://github.com/tradle/rn-nodeify if you want to install these modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment