如何使用 Expo 清除(重置缓存)反应本机。不确定是否缓存问题

我正在构建一个简单的 React Nativeapp,它使用 create-response-ative- 应用程序,只使用反应导航和 base-64(base64 encode/decode)作为依赖项。随着时间的推移,启动应用程序变得越来越慢,现在有时它会卡住(等待约30分钟)在“启动包装器...”后运行 NPM 启动。

我试过用“ npm start —— Reet-cache”启动它,但是没有任何改变

一旦它启动并运行,我没有得到任何错误或警告在 DevTools 或终端。而且这个应用程序的性能也没有问题

我该怎么做才能使 NPM 像以前一样平稳、快速地启动?是否有任何一般步骤,我可以采取这个问题的故障排除?

这是我的包 Json

{
"name": "test",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "~27.0.0",
"react-devtools": "^3.2.3",
"react-native-scripts": "1.14.0",
"react-test-renderer": "16.3.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"base-64": "^0.1.0",
"expo": "^27.0.1",
"react": "16.3.1",
"react-native": "~0.55.2",
"react-navigation": "^2.11.2"
}
}
157216 次浏览

expo r -c

According to this forum post from an Expo dev, that's the command to start it cache clean

EDIT: They have changed it from exp r -c to expo start -c

The command to run is:

expo r -c

I was running expo build:ios and needed to clear the cached provisioning profile. I did so with:

expo build:ios --clear-provisioning-profile

To see the full list of commands that clear specific elements from the cache, run expo build:ios --help

In you console run:

expo start

After the QR code is shown, press SHIFT + R keys.

I did "expo r -c" That worked for me.