question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

Cannot install Pods when init App

See original GitHub issue

Environment

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:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
patgoleycommented, Nov 5, 2019

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).

0reactions
lysenkoocommented, Oct 22, 2019

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS pod install is failing on project init #30690 - GitHub
i have two versions of XCode and this issue i encountered if i create a new project in Xcode 13 version and then...
Read more >
cocoapods not installing - Stack Overflow
cocoapods not installing ยท 1. cocoapods.org/app download cocoapods app from this link, then open your podfile using the app and click on install...
Read more >
Trouble with installing cocoapods | Apple Developer Forums
Tried the CocoaPod mac app from the CocoaPods about page, which did have an option to install the command line tool, but it...
Read more >
Troubleshooting - CocoaPods Guides
Go to Product > Edit Scheme ยท Click on Build ยท Add the Pods static library, and make sure it's at the top...
Read more >
How to fix โ€œpod installโ€ error in React Native on Mac M1
sudo gem install cocoapods. to install cocoapods , the standard dependency manager for Swift and Objective-C projects. ยท npx react-native init AwesomeApp --ย ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found