防止 `npm install` 为 React Native 应用程序重新编译 iOS 框架

Prevent `npm install` from recompiling iOS frameworks for React Native app

我们的 React Native 应用程序有一个后端依赖项 (react-native-ble-plx),需要使用 carthage 编译后端框架。每次我 运行 npm install 这个依赖依赖的 iOS 框架都会被重新编译,这需要很长时间(> 10 分钟)。

有没有办法(npm 参数?)让 npm install 不在每次 运行 时都从头开始重新编译所有内容?

改用npm update。它只会下载和安装需要更新的包(使用 SemVer 版本控制规则)。