17

I just started learning react-native. While trying to run npx pod-install I get:

Scanning for pods...
1.11.3
> pod install
Auto-linking React Native modules for target `AudioOnlyRN`: RNCAsyncStorage, RNCClipboard, react-native-background-timer, react-native-daily-js, and react-native-webrtc
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json

[!] Invalid `Podfile` file: no implicit conversion of nil into String.

 #  from /.../react-native/ios/Podfile:9
 #  -------------------------------------------
 #
 >    use_react_native!(:path => config["reactNativePath"])
 #
 #  -------------------------------------------
Couldn't install Pods. Updating the Pods project and trying again...
> pod install --repo-update
Auto-linking React Native modules for target `AudioOnlyRN`: RNCAsyncStorage, RNCClipboard, react-native-background-timer, react-native-daily-js, and react-native-webrtc
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json

[!] Invalid `Podfile` file: no implicit conversion of nil into String.

 #  from /.../react-native/ios/Podfile:9
 #  -------------------------------------------
 #
 >    use_react_native!(:path => config["reactNativePath"])
 #
 #  -------------------------------------------
Couldn't install Pods. Updating the Pods project and trying again...
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file: no implicit conversion of nil into String.

 #  from /.../react-native/ios/Podfile:9
 #  -------------------------------------------
 #
 >    use_react_native!(:path => config["reactNativePath"])
 #
 #  -------------------------------------------

Any idea what mismatch do I have going on here?

I'm not sure I understand the hierarchy of the relationships between node_modules/package.json and Podfile.

1
  • Did you manage to fix the error? I have the same problem Commented May 1, 2024 at 8:01

2 Answers 2

70

try changing

use_react_native!(:path => config["reactNativePath"])
                                  ^               ^

to

use_react_native!(:path => config[:reactNativePath])
                                  ^
Sign up to request clarification or add additional context in comments.

2 Comments

not working for me
I already have that use_react_native!(:path => config[:reactNativePath], but still getting the issue.
1

I ran into a very similar (albeit different) error:

[!] Invalid `Podfile` file: no implicit conversion of Pathname into String.

For me the issue was that react-native was set as a peer dependency. When I added react-native as a regular dependency, the pod install worked without error.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.