Reputation: 878
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.
Upvotes: 17
Views: 12710
Reputation: 876
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.
Upvotes: 1
Reputation: 941
try changing
use_react_native!(:path => config["reactNativePath"])
^ ^
to
use_react_native!(:path => config[:reactNativePath])
^
Upvotes: 69