react-native bundle 不工作(完成但不是捆绑项目)

react-native bundle not working (done but not bundle project)

当我 运行

我正在开发一个 React Native 项目
npm start -- --reset-cache

react-native run-ios

打开一个终端Running Metro Bundler on port 8081.就完成了 但模拟没有捆绑项目带来旧版本。

我尝试删除 node_modules 再次安装并以相同的方式删除 pod 文件,但它仍然无法正常工作我也尝试了清除捆绑但仍然没有捆绑我的项目?

有什么想法吗?

尝试

watchman watch-del-all

删除所有监视和相关触发器,link

这应该可以,如果不行,请尝试删除 watchman 并重新安装。 使用:

brew uninstall watchman
brew install watchman
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start --reset-cache

只要您想清除 RN 项目中的所有缓存,您都可以尝试使用上述脚本