Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module 'react-transform-hmr/lib/index.js'

After installing React native, I run following command:

$ react-native init demoApp

And got this error:

Error: Cannot find module 'react-transform-hmr/lib/index.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.require.resolve (internal/module.js:16:19)
at makeMakeHMRConfig7 (/home/local/MPLLC/malwinder.singh/demoApp/node_modules/react-native/node_modules/metro/src/babel-bridge.js:120:31)
at Object.<anonymous> (/home/local/MPLLC/malwinder.singh/demoApp/node_modules/react-native/node_modules/metro/src/babel-bridge.js:49:24)
at Module._compile (module.js:409:26)
at Module._extensions..js (module.js:416:10)
at Object.require.extensions.(anonymous function) [as .js] (/home/local/MPLLC/malwinder.singh/demoApp/node_modules/react-native/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)

What am I missing? How to fix this issue?

like image 442
Malwinder Singh Avatar asked Oct 17 '22 19:10

Malwinder Singh


2 Answers

npm install react-transform-hmr

This solved the issue for me

like image 93
Ranjith Kumar Avatar answered Oct 20 '22 15:10

Ranjith Kumar


The below command fixed the issue for me

react-native start --reset-cache
like image 38
Hemadri Dasari Avatar answered Oct 20 '22 17:10

Hemadri Dasari