---
tags: react-native,
disqus: hackmd
---
# 安裝RN遇到的坑
### IPHONEOS_DEPLOYMENT_TARGET is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99

上網google,會得到很多類似下面的這種解答,但是並不是替換後存檔就有用。
換上後請進到專案資料夾下的ios folder,然後下`Pod install`
```
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
end
end
end
```
注意這個8.0必須跟你的platform :ios, '8.0'一致
`['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'`

如果你找到的版本是沒有版本號的,就直接貼上後做`Pod install`看看,我自己還沒試過沒版本號的
[解决:The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range ...](https://blog.csdn.net/haha223545/article/details/105165247)
---
### nvm is not compatible with the "PREFIX" environment variable: currently set to "/usr/local"
Run `unset PREFIX` to unset it.

解法:到`node_modules>react-native/script/find-node.sh`這隻檔案裡,在最上面加上`unset PREFIX`,然後再試一次你的build指令,我是使用`yarn ios`

[參考文章](https://github.com/react-native-community/upgrade-support/issues/138)
---