admin管理员组

文章数量:1334419

When I launch :

react-native bundle --entry-file='index.js' --bundle-output='./ios/MyProject/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'

I have an error which says that :

Unable to resolve module `util` from `/Users/canatac/RNProjects/<MyProject>/node_modules/<A_Module>/lib/Bot.js`: Module `<A_Module>` does not exist in the Haste module map.

But what is a Haste module map ?

When I launch :

react-native bundle --entry-file='index.js' --bundle-output='./ios/MyProject/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'

I have an error which says that :

Unable to resolve module `util` from `/Users/canatac/RNProjects/<MyProject>/node_modules/<A_Module>/lib/Bot.js`: Module `<A_Module>` does not exist in the Haste module map.

But what is a Haste module map ?

Share Improve this question edited Jan 7, 2019 at 8:18 wscourge 11.3k17 gold badges63 silver badges86 bronze badges asked Jun 30, 2018 at 17:16 Jan ATACJan ATAC 1,2621 gold badge18 silver badges37 bronze badges 1
  • 4 This is driving me nuts. I'm getting a similar error and for the life of me I cant find any documentation on this "Haste Module Map" , what it does, or how to fix it.. This is why these JS frameworks drive me so nuts. The whole damn ecosystem is bonkers – Shayne Commented Jan 29, 2019 at 13:29
Add a ment  | 

2 Answers 2

Reset to default 1

Same error occured for me once, and that Github thread has helped me.

I had a similar problem - what helped was running npm start -- --reset-cache mand.

Based on the question itself, it is somehow connected to /tmp/haste-map-react-native-packager-*, ergo React Native Packager.

I may found an interpretation. Haste is a deprecated Facebook dependency management system for static resources as this GitHub repo suggests.

This post in SO tells us Haste is an alternative to Node.

Then, I may conclude that a Haste Map is a map of all static dependency references of a node project AND as a deprecated system must be avoided in favor of Node module system.

本文标签: javascriptWhat is the Haste module map in nodejsStack Overflow