如何修复“找不到模块".../template.config"React Native 中的错误 [英] How to fix "Can not find module ".../template.config" error in React Native

查看:59
本文介绍了如何修复“找不到模块".../template.config"React Native 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 react-native init MyApp 在 React Native 中创建一个新应用程序,但出现此错误:

I'm trying to create a new application in React Native using react-native init MyApp But I got this error:

√ 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

我需要做什么来解决这个问题?

What do I need to do to solve this problem?

推荐答案

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

这篇关于如何修复“找不到模块".../template.config"React Native 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆