Command 'pod install' failed (head -n 1)
Hi! π
Firstly, thanks for your work on this project! π
Got error "β οΈ Something went wrong running pod installin theiosdirectory."
Below is the error:
Command 'pod install' failed.
ββ Cause: /bin/bash -c
set -e
CURRENT_PATH=$(pwd)
mkdir -p Headers
XCFRAMEWORK_PATH=$(find "$CURRENT_PATH" -type d -name "ReactNativeDependencies.xcframework")
HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | head -n 1)
# Check if XCFRAMEWORK_PATH is empty
if [ -z "$XCFRAMEWORK_PATH" ]; then
echo "ERROR: XCFRAMEWORK_PATH is empty."
exit 0
fi
# Check if HEADERS_PATH is empty
if [ -z "$HEADERS_PATH" ]; then
echo "ERROR: HEADERS_PATH is empty."
exit 0
fi
cp -R "$HEADERS_PATH/." Headers
mkdir -p framework/packages/react-native
cp -R "$XCFRAMEWORK_PATH/../." framework/packages/react-native/
find "$XCFRAMEWORK_PATH/.." -type f -exec rm {} +
find "$CURRENT_PATH" -type d -empty -delete
Unknown option: n
Usage: head [-options] <url>...
-m <method> use method for the request (default is 'HEAD')
-f make request even if head believes method is illegal
-b <base> Use the specified URL as base
-t <timeout> Set timeout value
-i <time> Set the If-Modified-Since header on the request
-c <conttype> use this content-type for POST, PUT, CHECKIN
-a Use text mode for content I/O
-p <proxyurl> use this as a proxy
-P don't load proxy settings from environment
-H <header> send this HTTP header (you can specify several)
-u Display method and URL before any response
-U Display request headers (implies -u)
-s Display response status code
-S Display response status chain
-e Display response headers
-d Do not display content
-o <format> Process HTML content in various ways
-v Show program version
-h Print this message
-x Extra debugging output
pod install --repo-update --ansi exited with non-zero code: 1
Today I used patch-package to patch [email protected] for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec b/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec
index e08e6c2..0a63709 100644
--- a/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec
+++ b/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec
@@ -44,11 +44,12 @@ Pod::Spec.new do |spec|
# We need to make sure that the headers are copied to the right place - local tar.gz has a different structure
# than the one from the maven repo
+ # HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | head -n 1)
spec.prepare_command = <<-CMD
CURRENT_PATH=$(pwd)
mkdir -p Headers
XCFRAMEWORK_PATH=$(find "$CURRENT_PATH" -type d -name "ReactNativeDependencies.xcframework")
- HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | head -n 1)
+ HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | /usr/bin/head -n 1)
# Check if XCFRAMEWORK_PATH is empty
if [ -z "$XCFRAMEWORK_PATH" ]; then
This issue body was partially generated by patch-package.
[!WARNING] Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
- For majority of bugs: send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
- If your bug is UI related: a Snack
- If your bug is build/upgrade related: a project using our Reproducer Template
You can read more about about it on our website: How to report a bug.
Hi! π
Firstly, thanks for your work on this project! π
Got error
"β οΈ Something went wrong runningpod installin theiosdirectory."Below is the error:
Command 'pod install' failed. ββ Cause: /bin/bash -c set -e CURRENT_PATH=$(pwd) mkdir -p Headers XCFRAMEWORK_PATH=$(find "$CURRENT_PATH" -type d -name "ReactNativeDependencies.xcframework") HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | head -n 1)
Check if XCFRAMEWORK_PATH is empty
if [ -z "$XCFRAMEWORK_PATH" ]; then echo "ERROR: XCFRAMEWORK_PATH is empty." exit 0 fi
Check if HEADERS_PATH is empty
if [ -z "$HEADERS_PATH" ]; then echo "ERROR: HEADERS_PATH is empty." exit 0 fi
cp -R "$HEADERS_PATH/." Headers mkdir -p framework/packages/react-native cp -R "$XCFRAMEWORK_PATH/../." framework/packages/react-native/ find "$XCFRAMEWORK_PATH/.." -type f -exec rm {} + find "$CURRENT_PATH" -type d -empty -delete
Unknown option: n Usage: head [-options]
... -m use method for the request (default is 'HEAD') -f make request even if head believes method is illegal -b Use the specified URL as base -t Set timeout value -i -u Display method and URL before any response -U Display request headers (implies -u) -s Display response status code -S Display response status chain -e Display response headers -d Do not display content -o <format> Process HTML content in various ways -v Show program version -h Print this message -x Extra debugging outputpod install --repo-update --ansi exited with non-zero code: 1 Today I used patch-package to patch
[email protected]for the project I'm working on.Here is the diff that solved my problem:
diff --git a/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec b/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec index e08e6c2..0a63709 100644 --- a/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec +++ b/node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec @@ -44,11 +44,12 @@ Pod::Spec.new do |spec|
We need to make sure that the headers are copied to the right place - local tar.gz has a different structure
than the one from the maven repo
HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | head -n 1)
spec.prepare_command = <<-CMD CURRENT_PATH=$(pwd) mkdir -p Headers XCFRAMEWORK_PATH=$(find "$CURRENT_PATH" -type d -name "ReactNativeDependencies.xcframework")
- HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | head -n 1)
HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | /usr/bin/head -n 1)
Check if XCFRAMEWORK_PATH is empty
if [ -z "$XCFRAMEWORK_PATH" ]; then This issue body was partially generated by patch-package.
Steps i took:
Step 1:
npm install patch-package postinstall-postinstall --save-dev
Step 2:
Add "postinstall": "patch-package" to "scripts" in package.json
"scripts": { "postinstall": "patch-package" }
Step 3:
npx patch-package react-native
Step 4
cd ios pod deintegrate
Note: This error occurred on a React Native (Expo Project)
This really fixed my problem on macOS.