Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native invalid podfile "No such file or directory - ./node_modules/.bin/react-native."

In my react native project [email protected] in the iOS dir I get this issue when running a pod install

[!] Invalid `Podfile` file: No such file or directory - ./node_modules/.bin/react-native.

 #  from /Users/username/appname/ios/Podfile:44
 #  -------------------------------------------
 #  
 >    use_native_modules!
 #  end
 #  -------------------------------------------

This is a React Native fresh init from >@60.0; All worked perfect until I cleared my cache and installed node_modules with the following commands - this may have not been necessary or a good move on my part.

watchman watch-del-all && 
rm -rf $TMPDIR/react-native-packager-cache-* &&
rm -rf $TMPDIR/metro-bundler-cache-* && 
rm -rf node_modules/ 
&& npm cache clean --force &&
npm install && 
npm start -- --reset-cache

Here is my podfile

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'XXX' do
  # Pods for XXX
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  # Required by RNFirebase
  pod 'Firebase/Core', '~> 6.3.0'
  pod 'Firebase/Auth', '~> 6.3.0'
  pod 'Firebase/Firestore', '~> 6.3.0'

  pod 'GoogleIDFASupport', '~> 3.14.0'
  pod 'Fabric', '~> 1.10.2'
  pod 'Crashlytics', '~> 3.13.2'

  target 'XXXTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'XXX-tvOS' do
  # Pods for XXX-tvOS

  target 'XXX-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Here is my package.json

{
  "name": "XXX",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@gigasz/react-native-sketch-canvas": "github:jramalho/react-native-sketch-canvas",
    "@react-native-community/async-storage": "1.6.1",
    "@react-native-community/geolocation": "2.0.2",
    "@react-native-community/netinfo": "4.2.0",
    "@react-native-mapbox-gl/maps": "7.0.1",
    "@turf/turf": "5.1.6",
    "awaity": "1.0.0",
    "base-64": "0.1.0",
    "d3-scale": "3.1.0",
    "deepmerge": "4.0.0",
    "jetifier": "^1.6.4",
    "mobx": "5.13.0",
    "mobx-react": "6.1.3",
    "moment": "2.24.0",
    "prop-types": "15.7.2",
    "react": "16.8.6",
    "react-native": "0.60.5",
    "react-native-device-info": "2.3.2",
    "react-native-firebase": "5.5.6",
    "react-native-fs": "2.14.1",
    "react-native-gesture-handler": "1.4.1",
    "react-native-image-picker": "1.1.0",
    "react-native-image-progress": "1.1.1",
    "react-native-indicators": "0.13.0",
    "react-native-masked-text": "1.13.0",
    "react-native-modal-datetime-picker": "7.5.0",
    "react-native-paper": "2.16.0",
    "react-native-pdf": "5.1.4",
    "react-native-shake": "3.3.1",
    "react-native-status-bar-height": "2.4.0",
    "react-native-svg": "9.8.4",
    "react-native-svg-charts": "5.3.0",
    "react-native-vector-icons": "6.6.0",
    "react-navigation": "4.0.0",
    "react-navigation-material-bottom-tabs": "1.1.1",
    "react-navigation-stack": "^1.5.1",
    "rn-fetch-blob": "0.10.16",
    "uuid": "3.3.3"
  },
  "devDependencies": {
    "@babel/core": "7.5.5",
    "@babel/runtime": "7.5.5",
    "@react-native-community/eslint-config": "0.0.5",
    "babel-jest": "24.9.0",
    "babel-plugin-transform-remove-console": "6.9.4",
    "eslint": "6.3.0",
    "jest": "24.9.0",
    "metro-react-native-babel-preset": "0.54.1",
    "react-test-renderer": "16.8.6"
  },
  "jest": {
    "preset": "react-native"
  }
}

My CI build system still works fine with the same podfile and package.json

Any help will be appreciated!

like image 751
Hugo Pretorius Avatar asked Sep 05 '19 06:09

Hugo Pretorius


Video Answer


1 Answers

Make sure you are in /ios folder - pod install --project-directory=ios crashes for me but in /ios pod install works okay!

like image 187
enterteg Avatar answered Sep 22 '22 06:09

enterteg