react-native: Invalid Podfile on Appcenter
I’m taking the following error on pod install
:
[!] Invalid `Podfile` file: cannot load such file -- /node_modules/@react-native-community/cli-platform-ios/native_modules.
# from /ios/Podfile:2
# -------------------------------------------
# platform :ios, '9.0'
> require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
#
React Native version:
System: OS: macOS 10.14.6 CPU: (4) x64 Intel® Core™ i5-7360U CPU @ 2.30GHz Memory: 275.30 MB / 8.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 10.16.0 - /usr/local/bin/node Yarn: 1.16.0 - /usr/local/bin/yarn npm: 6.9.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2 IDEs: Android Studio: 3.4 AI-183.6156.11.34.5692245 Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild npmGlobalPackages: react-native-cli: 2.0.1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 8
- Comments: 18
I had the same error, and it was because I had not installed node dependencies and it was not able to find them at line:
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
I just ran
npm i
in project root and the error went away.Nevermind, I’ve configured Appcenter wrong. Instead of choosing the React Native configuration, I chose Object C and Swift 🤦♂
install yarn in terminall
Answering anything and closing the issue wont help!
I am also facing this issue but
npm i
did not solve the issue. This issue happens only on App Center and local build just works fine.Any one else is also facing the issue
Looks like I faced this problem cuz I switched my internet when
npm install
was preforming its job as it didn’t installed some packages properly.So deleting the
node_modules
folder and then usednpm install
in root to create it again worked for me.Hello @Daavidaviid, I’m using a monorepo architecture as well.
repo-name/react-native-mobile
. I solved the “can not load such file” issue by modifying therequire_relative
path inios/Podfile
toI face it
Same problem.