cli icon indicating copy to clipboard operation
cli copied to clipboard

[!] Invalid `Podfile` file: [!] /usr/local/bin/node -e try {console.log(require('@react-native-community/cli').bin);}

Open imdadulhaque1 opened this issue 3 years ago • 0 comments

I am failing to install iOS dependencies using pod install annd after pressing enter button to run pod install. Node Version: v16.16.0 NPM Version: 8.11.0

Working Process which I followed:

  1. First way to install pod: Firstly install npm then install pod
  2. Second way to install pod: after deleting node_modules then run pod install

Failed to install to follow the both of rules as mentioned before and to check the error, please check the attacthed file.

The dependencies are install in our projects as given below as package.json file.

  "name": "shohan",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.16.2",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/cli-platform-ios": "^8.0.6",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^6.1.2",
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@react-native-picker/picker": "^2.4.2",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/material-top-tabs": "^6.2.1",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/native-stack": "^6.5.0",
    "@rneui/base": "^0.0.0-edge.2",
    "@rneui/themed": "^0.0.0-edge.2",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "axios": "^0.26.1",
    "moment": "^2.29.2",
    "radio-buttons-react-native": "^1.0.4",
    "react": "17.0.2",
    "react-hook-form": "^7.28.1",
    "react-native": "0.67.3",
    "react-native-animatable": "^1.3.3",
    "react-native-audio-record": "^0.2.2",
    "react-native-bar-chart": "^0.1.0",
    "react-native-countdown-component": "^2.7.1",
    "react-native-date-picker": "^4.2.0",
    "react-native-datepicker": "^1.7.2",
    "react-native-dropdown-picker": "^5.3.0",
    "react-native-elevation": "^1.0.0",
    "react-native-emoji-selector": "^0.2.0",
    "react-native-fs": "^2.20.0",
    "react-native-image-picker": "^4.8.4",
    "react-native-infinite-scrolling": "^2.0.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-loading-spinner-overlay": "^3.0.0",
    "react-native-pager-view": "^5.4.15",
    "react-native-paper": "^4.12.1",
    "react-native-picker-select": "^8.0.4",
    "react-native-pure-chart": "^0.0.24",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "^4.1.2",
    "react-native-screens": "^3.13.1",
    "react-native-skeleton-placeholder": "^5.0.0",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-sound": "^0.11.2",
    "react-native-step-indicator": "^1.0.3",
    "react-native-super-grid": "^4.4.0",
    "react-native-svg": "^12.4.0",
    "react-native-swiper-flatlist": "^3.0.16",
    "react-native-tab-view": "^3.1.1",
    "react-native-text-gradient": "^0.1.7",
    "react-native-vector-icons": "^9.1.0",
    "react-native-video": "^2.3.1",
    "react-native-video-player": "^0.12.0",
    "react-native-webview": "^11.18.1",
    "react-native-youtube-iframe": "^2.2.2",
    "socket.io-client": "^4.5.1"
  },
  "devDependencies": {
    "@babel/core": "^7.17.5",
    "@babel/runtime": "^7.17.2",
    "@react-native-community/eslint-config": "^3.0.1",
    "babel-jest": "^27.5.1",
    "eslint": "^8.11.0",
    "jest": "^27.5.1",
    "metro-react-native-babel-preset": "^0.69.0",
    "react-test-renderer": "17.0.2"
  },
  "jest": {
    "preset": "react-native"
  }
}

Here is the Podfile's code is given below,

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'shohan' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  target 'shohanTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

Occured error is given in attatched file please check it and help me. Screenshot 2022-08-14 at 1 06 39 PM

imdadulhaque1 avatar Aug 14 '22 07:08 imdadulhaque1