Cannot install Pods when init App
See original GitHub issueEnvironment
System: OS: macOS High Sierra 10.13.6 CPU: (4) x64 Intelยฎ Coreโข i5-2557M CPU @ 1.70GHz Memory: 24.54 MB / 4.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.10.0 - /usr/local/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.11.3 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 22, 23, 25, 26, 27, 28 Build Tools: 23.0.1, 26.0.1, 26.0.2, 27.0.3, 28.0.3 System Images: android-26 | Google APIs Intel x86 Atom_64 IDEs: Android Studio: 3.3 AI-182.5107.16.33.5264788 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.2 => 0.61.2 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7
Description
When i run command
npx react-native init MyApp
Process ended with error:
Info All dependencies
โโ @babel/core@7.6.2
โโ @babel/runtime@7.6.2
โโ @react-native-community/eslint-config@0.0.5
โโ @types/eslint-visitor-keys@1.0.0
โโ @types/json-schema@7.0.3
โโ @typescript-eslint/eslint-plugin@1.13.0
โโ @typescript-eslint/parser@1.13.0
โโ acorn-jsx@5.0.2
โโ acorn@7.1.0
โโ ajv@6.10.2
โโ babel-jest@24.9.0
โโ chardet@0.7.0
โโ doctrine@3.0.0
โโ eslint-scope@5.0.0
โโ eslint-utils@1.4.2
โโ eslint@6.5.1
โโ espree@6.1.1
โโ esquery@1.0.1
โโ external-editor@3.1.0
โโ file-entry-cache@5.0.1
โโ flat-cache@2.0.1
โโ flatted@2.0.1
โโ glob-parent@5.1.0
โโ ignore@4.0.6
โโ import-fresh@3.1.0
โโ inquirer@6.5.2
โโ is-extglob@2.1.1
โโ is-glob@4.0.1
โโ jest@24.9.0
โโ json-stable-stringify-without-jsonify@1.0.1
โโ levn@0.3.0
โโ lodash.unescape@4.0.1
โโ metro-react-native-babel-preset@0.56.0
โโ optionator@0.8.2
โโ parent-module@1.0.1
โโ progress@2.0.3
โโ react-test-renderer@16.9.0
โโ rxjs@6.5.3
โโ strip-json-comments@3.0.1
โโ table@5.4.6
โโ text-table@0.2.0
โโ tslib@1.10.0
โโ tsutils@3.17.1
โโ v8-compile-cache@2.1.0
โโ write@1.0.3
โจ Done in 24.13s.
info Installing required CocoaPods dependencies
[!] Invalid `Podfile` file: cannot infer basepath.
# from /works/MyApp/ios/Podfile:2
# -------------------------------------------
# platform :ios, '9.0'
> require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
#
# -------------------------------------------
(node:33132) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./MyApp/ios && pod install".
CocoaPods documentation: https://cocoapods.org/
at installPods (/works/MyApp/node_modules/@react-native-community/cli/build/tools/installPods.js:157:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:33132) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:33132) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
In โฆ/node_modules/@react-native-community/cli-platform-ios/ i cannot find directory native_modules
pod --version 1.8.1
Reproducible Demo
Itโs reproduce on my PC
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)

Top Related StackOverflow Question
I got this same error and the problem was the version of Ruby I was using when running
pod install. I had been using Ruby v2.1.0 (same as issue author above). Upgrading to Ruby v2.4.1 fixed the issue (require_relative was not supported in evalโd files in 2.1.0).@thymikee Hi! I remove โglobalโ cache (in home dir ) for all components: npm, yarn, cocoapod. In other words i leave only binaries, than i upgrade all binaries - brew, cocoapod, npm etc.
And now i can init RN app 0.61, with cli 3.0-alpha without errors.
Thank you.