5

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?

6
  • try to reinstall the react-native cli Commented May 2, 2018 at 20:01
  • Done. Still not working. Commented May 2, 2018 at 20:39
  • Were you able to find a solution to this?Im stuck with the same error. Commented May 5, 2018 at 12:10
  • Yes. I installed required packages: create-react-native-app Commented May 7, 2018 at 19:11
  • would be nice if you gave a detailed solution for us beginners brahski. Commented May 10, 2018 at 16:44

2 Answers 2

2
npm install react-transform-hmr

This solved the issue for me

Sign up to request clarification or add additional context in comments.

1 Comment

yarn add --dev react-transform-hmr
1

The below command fixed the issue for me

react-native start --reset-cache

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.