找不到模块"babel-preset-react" [英] Cannot find module 'babel-preset-react'

查看:568
本文介绍了找不到模块"babel-preset-react"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的第一个React Native项目.仓库位于此处.

This is my first React Native project. The repo is here.

当我启动 expo 时,出现错误:

When I start up expo, I get the error:

Cannot find module 'babel-preset-react'

其他中,它具有以下依赖关系:

Among others, it has these dependencies:

"expo": "^32.0.0",
"react": "16.8.4",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.1.tar.gz",
"@babel/core": "7.3.4",
"babel-core": "^7.0.0-bridge.0",
"@babel/preset-react": "^7.0.0",

我在应用程序的/node_modules中找到了这四个库,每个库都包含对"babel-preset-react"的开发依赖项:

I found these four libraries in my app's /node_modules that each contain a dev dependency on "babel-preset-react":

起重非反应性静态,道具类型,react-input-autosize和 反应代理.

hoist-non-react-statics, prop-types, react-input-autosize and react-proxy.

这些都没有依赖于"@ babel/preset-react"的较新版本.

None of these have newer versions that depend on "@babel/preset-react".

推荐答案

这似乎与博览会项目处于不良状态有关.

This seems to be an issue to do with an expo project being in a bad state.

Expo是一组明确的lib,旨在简化开发,但与大多数野生的本地示例不兼容.

Expo is an express set of libs with the goal of simplifying development, but it is not compatible with most react native examples in the wild.

经过进一步的审查,您似乎已经在基于Expo的项目中遵循了常规的react native示例,而没有首先弹出.

After further review, it looks like you may have followed a regular react native example in an Expo based project, without first ejecting.

这篇关于找不到模块"babel-preset-react"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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