Malwinder Singh
Malwinder Singh

Reputation: 7060

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?

Upvotes: 5

Views: 2338

Answers (2)

Hemadri Dasari
Hemadri Dasari

Reputation: 33994

The below command fixed the issue for me

react-native start --reset-cache

Upvotes: 1

Ranjith Kumar
Ranjith Kumar

Reputation: 211

npm install react-transform-hmr

This solved the issue for me

Upvotes: 2

Related Questions