react-native - 如何修复 React Native 中的 "Can not find module ".../template.config” 错误

标签 react-native

我正在尝试使用 react-native init MyApp 在 React Native 中创建一个新应用程序但我收到了这个错误:

√ Downloading template
× Copying template
error Error: Cannot find module 'C:\Users\Emre\AppData\Local\Temp\rncli-init-template-hNGjwo\node_modules\react-native\template.config'

我试过的:
npm install -g react-native-cli
然后
react-native init MyApp
我需要做什么来解决这个问题?

最佳答案

yarn global add @react-native-community/cli@2.0.0-rc.2然后 react-native init MyApp为我工作

关于react-native - 如何修复 React Native 中的 "Can not find module ".../template.config” 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58145014/

相关文章:

javascript - 如何在 React Native 中使用 ref 清除文本组件

reactjs - componentWillReceiveProps 不更新函数中的状态

javascript - 无法读取未定义的属性 'props'

javascript - React Native - React Native Firebase - Google 登录 Android

react-native - react native 测试-立即行动

react-native - 有没有一种方法可以在一些数据间隔后在垂直平面列表中实现水平平面列表?

ios - 存档时链接器命令失败

react-native - 任务 ':react-native-firebase:compileDebugJavaWithJavac' 执行失败

javascript - react native : Compare app versions and return major or minor strings

android - react native 获取。 CertPathValidatorException 错误