cli: [!] Invalid `Podfile` file: 784: unexpected token at '(node:12804)

Environment

System:
    OS: macOS High Sierra 10.13.6
    CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
    Memory: 202.45 MB / 8.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.3.2 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    Android SDK:
      API Levels: 22, 23, 24, 25, 26, 27, 28
      Build Tools: 25.0.0, 27.0.3, 28.0.3
      System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.2 AI-181.5540.7.32.5014246
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.0-rc.3 => 0.60.0-rc.3

Description

when i run react-native init RN060 --version react-native@next on Mac OS terminal

report follow error information:

├─ tsutils@3.14.0
└─ write@1.0.3
✨  Done in 28.97s.
info Installing required CocoaPods dependencies

[!] Invalid `Podfile` file: 784: unexpected token at '(node:12804) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
'.

 #  from /Users/lg/RN060/ios/Podfile:36
 #  -------------------------------------------
 #  
 >    use_native_modules!
 #  end
 #  -------------------------------------------

(node:12744) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./RN060/ios && pod install".
CocoaPods documentation: https://cocoapods.org/
    at installPods (/Users/lg/RN060/node_modules/@react-native-community/cli/build/tools/installPods.js:148:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12744) 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:12744) [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.

pod --version 1.7.3

Reproducible Demo

no demo

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 26 (14 by maintainers)

Most upvoted comments

My issue was that I had react-native-cli as a dependency, Everything worked fine once I removed it and the error didn’t show up again. Hope somebody might find this useful.

@lgj1993 Hey guys! upgrade the your yarn to 1.16 can be fix this issue.

Run following sh command on the terminal:

curl -o- -L https://yarnpkg.com/install.sh | bash

I tried using CocoaPods 1.6.1 and 1.7.3 on macOS, same Node version, newer Yarn (1.16), but cannot repro. Is this happening consistently? Can you try with Yarn 1.16?

@A-Tokyo doing the same stuff here hehehe… have taken some hours to solve xD

I tried using CocoaPods 1.6.1 and 1.7.3 on macOS, same Node version, newer Yarn (1.16), but cannot repro. Is this happening consistently? Can you try with Yarn 1.16?

“Your replies are many but none is relevant to the issue, please reply to the issue and provide a solution” Request you to please respond only if you are aware about the solution

We should always remove the temporary directory where template lives, but I think we can safely get rid of removing the new project when something fails