when I have a react native project....and when I run pod install
it gives me the following error
Invalid `Podfile` file: cannot load such file -- /myPath/node_modules/react-native/scripts/react_native_pods
Here is my podfile
require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios, '10.0' target 'xs' do config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) target 'xsTests' do inherit! :complete # Pods for testing end # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. use_flipper! post_install do |installer| flipper_post_install(installer) end end target 'xs-tvOS' do # Pods for xs-tvOS target 'xs-tvOSTests' do inherit! :search_paths # Pods for testing end end
Ive checked and there is no file called react_native_pods
in location myPath/node_modules/react-native/scripts/
. Im wondering if its something to do with npm install
is not generating correct files.....however I upgraded node to most recent version and then ran npm install
To install the pods, do one of the following: Place the caret at the code line where you add the pod, press ⌥ ⏎ , select Install, and press ⏎ . Click Install pods in the top-left corner of the editor window. From the main menu, select Tools | CocoaPods | Install.
I ran npm audit fix
and it added react_native_pods
file and pod install
then worked
Run npm audit fix ==> cd ios ==> pod install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With