【发布时间】:2018-05-02 19:56:35
【问题描述】:
安装 React native 后,我运行以下命令:
$ react-native init demoApp
得到了这个错误:
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)
我错过了什么?如何解决这个问题?
【问题讨论】:
-
尝试重新安装 react-native cli
-
完成。还是不行。
-
你能找到解决方案吗?我遇到了同样的错误。
-
是的。我安装了所需的包:create-react-native-app
-
如果您为我们初学者布拉斯基提供详细的解决方案会很好。
标签: java android react-native kotlin react-native-android