Skip to content
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

Closed
3 tasks done
JonathanReisCom opened this issue Sep 28, 2018 · 2 comments
Closed
3 tasks done

Unable to resolve module assert buffer events #21405

JonathanReisCom opened this issue Sep 28, 2018 · 2 comments
Labels
Bug Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@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

@react-native-bot react-native-bot added the Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. label Sep 28, 2018
@rajivshah3
Copy link
Contributor

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.

@cpojer
Copy link
Contributor

cpojer commented Mar 20, 2019

See the previous comment, this is by design. React Native is not an implementation of node.js.

@cpojer cpojer closed this as completed Mar 20, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Mar 20, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

No branches or pull requests

5 participants