React Native Expo 找不到变量自身 [英] React Native Expo Can't Find Variable Self

查看:48
本文介绍了React Native Expo 找不到变量自身的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 expo 中创建新项目时突然收到此错误,当我创建任何项目时,它都能完美加载并且可以看到默认屏幕.

I am suddenly getting this error while creating the new project in expo, when I create any project it loads perfectly and can see the default screen.

当我尝试安装任何依赖项时,例如纱线添加原生基础它停止工作,让我无法找到变量自我和世博会被绞死

When I try to install any dependancy e.g. yarn add native-base it stops working and giving me can't Find Variable Self and Expo gets hanged

请帮忙提前谢谢

推荐答案

对于使用 expo-cli 或 XDE 创建新项目的用户,在第一次yarn"或"npm 安装".这是因为昨天发布了新的whatwg-fetch"3.0.0 (https://www.npmjs.com/package/whatwg-fetch 23).所以你只需要强制依赖以前的版本: "whatwg-fetch": "^2.0.4"这意味着将其作为依赖项"放在 package.json 中.手动,使用yarn add whatwg-fetch@2.0.4".或者使用npm add whatwg-fetch@2.0.4".

For users creating new project with expo-cli or XDE, you will get red screen "Can’t Find Variable Self" after your first "yarn" or "npm install". This is because of new "whatwg-fetch" 3.0.0 published yesterday (https://www.npmjs.com/package/whatwg-fetch 23). So you just need to force dependency to previous version: "whatwg-fetch": "^2.0.4" It means put it in package.json as "dependency". Manually, with "yarn add whatwg-fetch@2.0.4." Or with "npm add whatwg-fetch@2.0.4".

现在一切都应该像一个魅力.

Everything should now work like a charm.

希望对你有帮助;p

链接:

https://forums.expo.io/t/cant-find-variable-self/13547

Up: expo@30.0.1 添加 whatwg-fetch@2.0.4 作为依赖.问题消失了;)

Up: expo@30.0.1 added whatwg-fetch@2.0.4 as dependency. Problem is gone ;)

这篇关于React Native Expo 找不到变量自身的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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