You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply, I can't install the pod for the React Native project when using Yarn - Berry or any newer version like 3.x or 4.x. Has anyone managed to make this work? Thanks!
Error from installing the pod using npx pod-install command
# from /Users/administrator/Desktop/abc/ios/Podfile:2
# -------------------------------------------
# # Resolve react_native_pods.rb with node to allow for hoisting
> require Pod::Executable.execute_command('node', ['-p',
# 'require.resolve(
# -------------------------------------------
Couldn't install Pods. Updating the Pods project and trying again...
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file: [!] /opt/homebrew/bin/node -p require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
) /Users/administrator/Desktop/abc/ios
node:internal/modules/cjs/loader:1205
throw err;
^
Error: Cannot find module 'react-native/scripts/react_native_pods.rb'
Require stack:
- /Users/administrator/Desktop/abc/ios/[eval]
at Module._resolveFilename (node:internal/modules/cjs/loader:1202:15)
at Function.resolve (node:internal/modules/helpers:199:19)
at [eval]:1:9
at runScriptInThisContext (node:internal/vm:209:10)
at node:internal/process/execution:118:14
at [eval]-wrapper:6:24
at runScript (node:internal/process/execution:101:62)
at evalScript (node:internal/process/execution:136:3)
at node:internal/main/eval_string:51:3 {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/Users/administrator/Desktop/abc/ios/[eval]' ]
}
Node.js v22.0.0
This issue can be reproduced by following these steps:
Set Yarn version to Berry: yarn set version berry
Initialize a new React Native project: npx react-native init abc
You will encounter failures when installing the pod files, even for existing projects. I'm using React Native versions 0.74.0 and 0.74.1.
React Native Version
0.74.1
Affected Platforms
Runtime - iOS
Output of npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 14.4.1
CPU: (8) arm64 Apple M1
Memory: 1.85 GB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.0.0
path: /opt/homebrew/bin/node
Yarn:
version: 3.6.4
path: /opt/homebrew/bin/yarn
npm:
version: 10.5.1
path: /opt/homebrew/bin/npm
Watchman:
version: 2024.04.22.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK: Not Found
IDEs:
Android Studio: 2023.3 AI-233.14808.21.2331.11709847
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java: Not Found
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
# from /Users/administrator/Desktop/abc/ios/Podfile:2
# -------------------------------------------
# # Resolve react_native_pods.rb with node to allow for hoisting
> require Pod::Executable.execute_command('node', ['-p',
# 'require.resolve(
# -------------------------------------------
Couldn't install Pods. Updating the Pods project and trying again...
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file: [!] /opt/homebrew/bin/node -p require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
) /Users/administrator/Desktop/abc/ios
node:internal/modules/cjs/loader:1205
throw err;
^
Error: Cannot find module 'react-native/scripts/react_native_pods.rb'
Require stack:
- /Users/administrator/Desktop/abc/ios/[eval]
at Module._resolveFilename (node:internal/modules/cjs/loader:1202:15)
at Function.resolve (node:internal/modules/helpers:199:19)
at [eval]:1:9
at runScriptInThisContext (node:internal/vm:209:10)
at node:internal/process/execution:118:14
at [eval]-wrapper:6:24
at runScript (node:internal/process/execution:101:62)
at evalScript (node:internal/process/execution:136:3)
at node:internal/main/eval_string:51:3 {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/Users/administrator/Desktop/abc/ios/[eval]' ]
}
Node.js v22.0.0
Had this same problem after new project, pod install failed as part of init script.
Solution:
cd project
npm i
npx pod-install
I tried only running npx pod-install, but needed the npm-packages first of course which somehow was not installed, but no errors. Noticed I was missing a package-lock.json-file.
Description
Simply, I can't install the pod for the React Native project when using Yarn - Berry or any newer version like 3.x or 4.x. Has anyone managed to make this work? Thanks!
Error from installing the pod using npx pod-install command
Here is my project package.json file
Steps to reproduce
This issue can be reproduced by following these steps:
You will encounter failures when installing the pod files, even for existing projects. I'm using React Native versions 0.74.0 and 0.74.1.
React Native Version
0.74.1
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/elite-mob/Reproducer_React_Native
Screenshots and Videos
The text was updated successfully, but these errors were encountered: