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.

cli-platform-ios pod install failure

See original GitHub issue

Environment

$ react-native info
info Fetching system and libraries information...
System:
    OS: macOS 10.15
    CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
    Memory: 7.31 GB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.3 - /usr/local/bin/node
    npm: 6.12.0 - /usr/local/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    Android SDK:
      API Levels: 23, 25, 27, 28, 29
      Build Tools: 28.0.3, 29.0.1, 29.0.2
      System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5900203
    Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.11.0 => 16.11.0 
    react-native: 0.61.2 => 0.61.2

Description

On a current project, after removing the package-lock.json and re-running npm install, a pod install in the ios directory fails:

$ pod install
Command `config` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.

[!] Invalid `Podfile` file: 767: unexpected token at ''.

 #  from /Users/ourvoiceusa/git/HelloVoter/mobile/ios/Podfile:44
 #  -------------------------------------------
 #  
 >    use_native_modules!
 #  end
 #  -------------------------------------------

Reproducible Demo

git clone https://github.com/OurVoiceUSA/HelloVoter.git
cd HelloVoter/mobile
npm install
cd ios
pod install

Then if you remove package-lock.json and re-install and try the npx react-native config from the ios directory again:

rm -f package-lock.json
npm install
cd ios
pod install

I believe this is due to npx react-native config failing to work inside the ios directory on the newer version of @react-native-community/cli-platform-ios

$ cd ios
$ npx react-native config
Command `config` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.

Here’s the package-lock.json change that broke it:

@@ -1295,12 +1292,13 @@
       }
     },
     "@react-native-community/cli-platform-ios": {
-      "version": "3.0.0-alpha.2",
-      "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-3.0.0-alpha.2.tgz",
-      "integrity": "sha512-37FtnrWTUP0EzQ83raplcnOUlEzRCsDrsxGsUnBso33fNPBAJ4Ei6L/BuJPJZ+sCAWFbyO1XhVED0c1QuP0cww==",
+      "version": "3.0.0-alpha.7",
+      "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-3.0.0-alpha.7.tgz",
+      "integrity": "sha512-6qM5LpzhCEhkb9MC+nxrOHX2TxoN4qm8+Vg9byIW/wExl8dWCTneRUbQ5qFlkkMksS2U63LiRVSCXK08d6x5bA==",
       "requires": {
-        "@react-native-community/cli-tools": "^2.8.3",
+        "@react-native-community/cli-tools": "^3.0.0-alpha.7",
         "chalk": "^2.4.2",
+        "js-yaml": "^3.13.1",
         "xcode": "^2.0.0"
       },
       "dependencies": {

Thanks,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
ifyapishorecommented, Oct 25, 2019

Have same issue.

Check your node_modules. image

Remove node_modules/react-native-cli. It has old version 2.0.1

Looks like after few npm installs, old version appears in node_modules somehow and broke many things.

There is an issue with resolving modules in gradle and seems like they are related.

BWT: After that react-native starts to be very slow (resolve modules on every start)

image

7reactions
aniruddhashevlecommented, Dec 10, 2019

I removed react-native-cli globally, yarn global remove react-native-cli

Then pod install worked for me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pod install fails? - react native - Stack Overflow
Pod install fails ? · I don't see DoubleConversion being specified anywhere in my projects or files. – James Anderbard · It look...
Read more >
@react-native-community/cli-platform-ios - npm
Start using @react-native-community/cli-platform-ios in your project by running `npm i @react-native-community/cli-platform-ios`.
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 >
Trouble with installing cocoapods | Apple Developer Forums
[!] Xcode - develop for iOS and macOS ✗ CocoaPods installed but not working. You appear to have CocoaPods installed but it is...
Read more >
Installation | React Native Navigation - Open Source
npm install --save react-native-navigation · yarn add react-native-navigation · pod install --project-directory=ios · react-native run-ios · platform :ios, '9.0'.
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