Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve the jest-haste-map error in react-native?

Tags:

react-native

Seen in my Metro Bundler console output:

Error: Cannot find module 'jest-haste-map'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:/Reat Native demo/kindbase-foodli-app-935bb0d21eae/

node_modules/react-native/packager/react-packager/src/node-haste/index.js:19:22)

I make a new project. But I run the react-native run-android and the issue still persists?

like image 596
Seasia Creative Crew Avatar asked Jan 12 '17 04:01

Seasia Creative Crew


2 Answers

open the file rn-cli.config.js and change it to the following :)

const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
  resolver: {
    blacklistRE: blacklist()
  }
};
like image 88
Fareed Alnamrouti Avatar answered Oct 15 '22 12:10

Fareed Alnamrouti


I reported this on the GitHub repo https://github.com/facebook/react-native/issues/21146

I had to

rm -rf node_modules npm install

to make it work

like image 45
onmyway133 Avatar answered Oct 15 '22 13:10

onmyway133