如何清除本机缓存? [英] How to clear react-native cache?

查看:275
本文介绍了如何清除本机缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在本机开发中,构建应用程序时会使用多个缓存:

In react-native development, there are multiple caches used when the app is built:

  1. 本机打包程序缓存
  2. 仿真器缓存
  3. Java端缓存(.gradle)文件夹(仅在android中)
  4. npm缓存(如果有的话?)

我也想念东西吗?因为我试图清除react-native中的缓存,以便能够重复仅在首次使用时发生的错误.但是清除上面的那些缓存并没有帮助.这是在android上.构建应用程序时,大多数行都不会像预期的那样显示最新信息,因为我清除了缓存.

Am I missing something also? Because I'm trying to clear cache in react-native, to be able to repeat a bug that only occurs on first usage. But clearing those caches above did not help. This is on android. When the app is building, most of the rows DO NOT say UP-TO-DATE, as expected, because I cleared the cache.

但是,仍有许多行用于打印此文本.喜欢:

But, there are still many rows where this text is printed. Like:

app:preBuild UP-TO-DATE

app:preBuild UP-TO-DATE

app:preDebugBuild截止日期

app:preDebugBuild UP-TO-DATE

:app:preReleaseBuild UP-TO-DATE

:app:preReleaseBuild UP-TO-DATE

问题是,如何清除与本机开发相关的整个缓存?

The question is, how can I clear the whole cache related to react-native development?

推荐答案

对于React Native Init方法(无expo),请使用:

For React Native Init approach (without expo) use:

npm start -- --reset-cache

这篇关于如何清除本机缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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