Seasia Creative Crew
Seasia Creative Crew

Reputation: 321

How to resolve the jest-haste-map error in 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?

Upvotes: 11

Views: 17688

Answers (3)

onmyway133
onmyway133

Reputation: 48175

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

Upvotes: 1

Fareed Alnamrouti
Fareed Alnamrouti

Reputation: 32174

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()
  }
};

Upvotes: 1

Hims
Hims

Reputation: 233

Try to uninstall react-native from node_module folder using command

npm uninstall react-native

and then re-install that module using command

npm install react-native

And run your app.

Upvotes: 16

Related Questions