infinitered / ignite

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!
MIT License
17.39k stars 1.38k forks source link

`npx ignite-cli new foo` fails #1661

Closed pepasibble closed 2 years ago

pepasibble commented 3 years ago

I must be doing something wrong here, because the very first step in the tutorial is failing:

$ npx ignite-cli new foo

   · · · · · · · · · · · · · · · · · · 🔥 Ignite 🔥 · · · · · · · · · · · · · · · · · ·

    █ Creating foo using Ignite 6.9.0
    █ Powered by Infinite Red - https://infinite.red
    █ Using react-native-cli
    ────────────────────────────────────────────────

    🔥 Igniting app
    🖨  3D-printing a new React Native app
    ⠙ Baking CocoaPods
/Users/pepasibble/.npm/_npx/e31027f3785124a8/node_modules/gluegun/build/index.js:13
    throw up;
    ^
Scanning for pods...
1.10.1
> pod install

[!] Invalid `Podfile` file: cannot load such file -- /Users/pepasibble/tmp/ignite-test/foo/node_modules/react-native/scripts/react_native_pods.

 #  from /Users/pepasibble/tmp/ignite-test/foo/ios/Podfile:1
 #  -------------------------------------------
 >  require_relative '../node_modules/react-native/scripts/react_native_pods'
 #  require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
 #  -------------------------------------------

Aborting run
An unexpected error was encountered. Please report it as a bug:
CocoaPodsError: Command `pod install` failed.
└─ Cause: pod exited with non-zero code: 1
    at CocoaPodsPackageManager._installAsync (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:86691)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async CocoaPodsPackageManager.installAsync (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:84878)
    at async runAsync (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:111085)
    at async /Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:111171 {
  code: 'COMMAND_FAILED',
  cause: Error: pod exited with non-zero code: 1
      at ChildProcess.h (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:1073)
      at Object.onceWrapper (node:events:472:26)
      at ChildProcess.emit (node:events:365:28)
      at maybeClose (node:internal/child_process:1067:16)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
      ...
      at Object.spawnAsync [as default] (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:558)
      at CocoaPodsPackageManager._runAsync (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:87473)
      at CocoaPodsPackageManager._installAsync (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:85195)
      at CocoaPodsPackageManager.installAsync (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:84889)
      at runAsync (/Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:111093)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async /Users/pepasibble/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:111171 {
    pid: 89907,
    output: [ '', '' ],
    stdout: '',
    stderr: '',
    status: 1,
    signal: null
  },
  isPackageManagerError: true
}

(Use `node --trace-uncaught ...` to show where the exception was thrown)

I checked and foo/node_modules/react-native/scripts/react_native_pods doesn't exist, because node_modules doesn't exist. It looks like npm install isn't getting run?

I've tried to ensure I have all of the dependencies installed, which are apparently documented in this course: https://academy.infinite.red/p/installing-react-native-tutorial-on-macos but I can't take the course because I get stuck in a loop:

Maybe the dependencies should just be listed in a gist? That would be much less prone to this sort of problem.


Steps to reproduce

  1. npx ignite-cli new foo

ignite doctor results:

I can't run ignite doctor because ignite doesn't seem to be a command on my system, but I can run npx ignite-cli doctor:

$ npx ignite-cli doctor
System
  platform           darwin                                                 
  arch               x64                                                    
  cpu                16 cores      Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz 
  directory          ignite-test   /Users/pepasibble/tmp/ignite-test        

JavaScript (and globally-installed packages)
  node               16.0.0       /usr/local/bin/node 
  npm                7.10.0       /usr/local/bin/npm  
    lumo-cljs        1.10.1                           
    npm              7.10.0                           
  yarn               -            not installed       

Ignite
  ignite-cli         6.9.0        /Users/pepasibble/.npm/_npx/e31027f3785124a8/node_modules/.bin/ignite      
  ignite src         build        /Users/pepasibble/.npm/_npx/e31027f3785124a8/node_modules/ignite-cli/build 

Android
  java               15.0.2       /usr/local/opt/openjdk/bin/java 
  android home       -            undefined                       

iOS
  xcode              12.4       
  cocoapods          1.10.1       /usr/local/bin/pod 
nirre7 commented 3 years ago

Try with the latest nodejs lts. To simplify multiple nodejs installations try nvm

imhashir commented 3 years ago

@nirre7 I am getting this error with lts version v14.16.1

npx ignite-cli new app 

   · · · · · · · · · · · · · · · · · · 🔥 Ignite 🔥 · · · · · · · · · · · · · · · · · ·

    █ Creating app using Ignite 6.9.2
    █ Powered by Infinite Red - https://infinite.red
    █ Using react-native-cli
    ────────────────────────────────────────────────

    🔥 Igniting app
    🖨  3D-printing a new React Native app
    ⠦ Baking CocoaPods
/Users/hashirbaig/.npm/_npx/78563/lib/node_modules/ignite-cli/node_modules/gluegun/build/index.js:13
    throw up;
    ^
npx: installed 1 in 0.999s
Scanning for pods...
1.10.1
> pod install

[!] Invalid `Podfile` file: cannot load such file -- /Users/hashirbaig/Documents/Development/Monorepos/facescope/packages/app/node_modules/react-native/scripts/react_native_pods.

 #  from /Users/hashirbaig/Documents/Development/Monorepos/facescope/packages/app/ios/Podfile:1
 #  -------------------------------------------
 >  require_relative '../node_modules/react-native/scripts/react_native_pods'
 #  require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
 #  -------------------------------------------

Aborting run
An unexpected error was encountered. Please report it as a bug:
CocoaPodsError: Command `pod install` failed.
└─ Cause: pod exited with non-zero code: 1
    at CocoaPodsPackageManager._installAsync (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:86691)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async CocoaPodsPackageManager.installAsync (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:84878)
    at async runAsync (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:111085)
    at async /Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:111171 {
  code: 'COMMAND_FAILED',
  cause: Error: pod exited with non-zero code: 1
      at ChildProcess.h (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:1073)
      at Object.onceWrapper (events.js:422:26)
      at ChildProcess.emit (events.js:315:20)
      at maybeClose (internal/child_process.js:1048:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
      ...
      at Object.spawnAsync [as default] (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:558)
      at CocoaPodsPackageManager._runAsync (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:87473)
      at CocoaPodsPackageManager._installAsync (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:85195)
      at CocoaPodsPackageManager.installAsync (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:84889)
      at runAsync (/Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:111093)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at async /Users/hashirbaig/.npm/_npx/78593/lib/node_modules/pod-install/build/index.js:2:111171 {
    pid: 78615,
    output: [ '', '' ],
    stdout: '',
    stderr: '',
    status: 1,
    signal: null
  },
  isPackageManagerError: true
}

(Use `node --trace-uncaught ...` to show where the exception was thrown)
nirre7 commented 3 years ago

@imhashir Looks environment specific, try to run npx ignite-cli doctor to check your setup, remove any old global react-native-cli installations if any.

ghost commented 3 years ago

same here

amanchoudhary2014 commented 3 years ago

same here

ghost commented 3 years ago

1 day Later it's can work , I don’t know why it's can work , maybe because i remove nodejs latest, then install node LTS ? i don't know why !!

nirre7 commented 3 years ago

Afaik nodejs lts uses npm 6. Also if you hade any "old" react-native-cli or ignite-cli installed they would not exist in your new lts installl and that might have solved your issues.

pepasibble commented 3 years ago

Just to document this in case it is useful to others, dropping back to node v14 causes npx ignite-cli new foo to work correctly.

The temporary hack I performed to try this was:

brew uninstall --ignore-dependencies node
brew install node@14
export PATH="/usr/local/opt/node@14/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/node@14/lib"
export CPPFLAGS="-I/usr/local/opt/node@14/include"
npx ignite-cli new foo

Of course, the question this raises is: Why does node v16 cause ignite to decide not to run npm install, and why is that not detected as a fatal condition (the tool continues to run and pod install is what fails)?

jamonholmgren commented 3 years ago

Hey everyone, thanks for adding your details! I've assigned this internally at Infinite Red and we'll try to get a solution worked out.

derekgreenberg commented 3 years ago

@pepasibble - try igniting a new app using the latest version of Ignite CLI. The easiest way to ensure you are doing this is to invoke npx ignite-cli rather than installing it globally.

I tried this using node 16.1 to ensure it works with your environment - without you having to downgrade node to v14. Here is the Terminal session:

~/git> npx ignite-cli --version
6.10.3

~/git> npx ignite-cli new foo

   · · · · · · · · · · · · · · · · · · 🔥 Ignite 🔥 · · · · · · · · · · · · · · · · · ·

    █ Creating foo using Ignite 6.10.3
    █ Powered by Infinite Red - https://infinite.red
    █ Using react-native-cli
    ────────────────────────────────────────────────

    🔥 Igniting app
    🖨  3D-printing a new React Native app
    ☕️ Baking CocoaPods
    🗄  Backing everything up in source control

   Ignite CLI ignited foo in 63.84s

   To get started:
     cd foo  
     npx react-native run-ios  
     npx react-native run-android  

   To run in Android, make sure you've followed the latest react-native setup
   instructions at https://facebook.github.io/react-native/docs/getting-started.html
   before using ignite. You won't be able to run Android successfully until you have.

   Need additional help?

   Join our Slack community at http://community.infinite.red.

   Now get cooking! 🍽
   · · · · · · · · · · · · · · · · · · 🔥 Ignite 🔥 · · · · · · · · · · · · · · · · · ·

~/git> npx ignite-cli doctor
System
  platform           darwin                                                
  arch               x64                                                   
  cpu                6 cores      Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz 
  directory          git          /Users/derekgreenberg/git                

JavaScript (and globally-installed packages)
  node               16.1.0       /Users/derekgreenberg/.nvm/versions/node/v16.1.0/bin/node 
  npm                7.11.2       /Users/derekgreenberg/.nvm/versions/node/v16.1.0/bin/npm  
    npm              7.11.2                                                                 
  yarn               1.22.5       /Users/derekgreenberg/.yarn/bin/yarn                      
    pod-install      0.1.21                                                                 

Ignite
  ignite-cli         6.10.3       /Users/derekgreenberg/node_modules/.bin/ignite      
  ignite src         build        /Users/derekgreenberg/node_modules/ignite-cli/build 

Android
  java               1.8.0_232    /usr/bin/java                             
  android home       -            /Users/derekgreenberg/Library/Android/sdk 

iOS
  xcode              12.5       
  cocoapods          1.10.1       /usr/local/bin/pod 
Illiece commented 3 years ago

Hello @pepasibble

I just installed yarn with this command line

npm install --global yarn

And the problem disappear

platon-rov commented 3 years ago

If you have Apple M1, that may solve your problem (from here):

# Install ffi
sudo arch -x86_64 gem install ffi

# Re-install dependencies
arch -x86_64 pod install

I'm also using Node 16 under Rosetta 2 (not arm).

benson7667 commented 3 years ago

No luck even i nvm switch to latest node version 16.1.0 Xcode Version: Version 12.4 (12D4e)

➜  Downloads npx ignite-cli new igniteDemo

   · · · · · · · · · · · · · · · · · · 🔥 Ignite 🔥 · · · · · · · · · · · · · · · · · ·

    █ Creating igniteDemo using Ignite 6.11.1
    █ Powered by Infinite Red - https://infinite.red
    █ Using react-native-cli
    ────────────────────────────────────────────────

    🔥 Igniting app
    🖨  3D-printing a new React Native app
    ⠇ Baking CocoaPods
/Users/benstoh/.npm/_npx/e31027f3785124a8/node_modules/gluegun/build/index.js:13
    throw up;
    ^
Scanning for pods...
Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2
Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3
1.10.1
> pod install

[!] Invalid `Podfile` file: cannot load such file -- /Users/benstoh/Downloads/igniteDemo/node_modules/react-native/scripts/react_native_pods.

 #  from /Users/benstoh/Downloads/igniteDemo/ios/Podfile:1
 #  -------------------------------------------
 >  require_relative '../node_modules/react-native/scripts/react_native_pods'
 #  require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
 #  -------------------------------------------

Aborting run
An unexpected error was encountered. Please report it as a bug:
CocoaPodsError: Command `pod install` failed.
└─ Cause: pod exited with non-zero code: 1
Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2
Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3
    at CocoaPodsPackageManager._installAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:92213)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async CocoaPodsPackageManager.installAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:90176)
    at async runAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:106198)
    at async /Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:106284 {
  code: 'COMMAND_FAILED',
  cause: Error: pod exited with non-zero code: 1
      at ChildProcess.h (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:1073)
      at Object.onceWrapper (node:events:472:26)
      at ChildProcess.emit (node:events:365:28)
      at maybeClose (node:internal/child_process:1067:16)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
      ...
      at Object.spawnAsync [as default] (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:558)
      at CocoaPodsPackageManager._runAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:92995)
      at CocoaPodsPackageManager._installAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:90499)
      at CocoaPodsPackageManager.installAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:90187)
      at runAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:106206)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async /Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:106284 {
    pid: 45270,
    output: [
      '',
      'Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2\n' +
        'Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3\n'
    ],
    stdout: '',
    stderr: 'Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2\n' +
      'Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3\n',
    status: 1,
    signal: null
  },
  isPackageManagerError: true
}

(Use `node --trace-uncaught ...` to show where the exception was thrown)
➜  Downloads node --version
v16.1.0
benson7667 commented 3 years ago

npm install --global yarn

@Illiece After installed yarn globally, pod install seems working now but with a new error inflipper

➜  Downloads npx ignite-cli new igniteTesting 

   · · · · · · · · · · · · · · · · · · 🔥 Ignite 🔥 · · · · · · · · · · · · · · · · · ·

    █ Creating igniteTesting using Ignite 6.11.1
    █ Powered by Infinite Red - https://infinite.red
    █ Using react-native-cli
    ────────────────────────────────────────────────

    🔥 Igniting app
    🖨  3D-printing a new React Native app
    ⠧ Baking CocoaPods
/Users/benstoh/.npm/_npx/e31027f3785124a8/node_modules/gluegun/build/index.js:13
    throw up;
    ^
Scanning for pods...
Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2
Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3
1.10.1
> pod install
Installing unimodules:
 expo-constants@9.3.5 from ../node_modules/expo-constants/ios
 expo-file-system@9.3.0 from ../node_modules/expo-file-system/ios
 expo-image-loader@1.3.0 from ../node_modules/expo-image-loader/ios
 expo-localization@9.1.0 from ../node_modules/expo-localization/ios
 expo-permissions@10.0.0 from ../node_modules/expo-permissions/ios
 unimodules-app-loader@1.4.0 from ../node_modules/unimodules-app-loader/ios
 unimodules-barcode-scanner-interface@5.4.0 from ../node_modules/unimodules-barcode-scanner-interface/ios
 unimodules-camera-interface@5.4.0 from ../node_modules/unimodules-camera-interface/ios
 unimodules-constants-interface@5.4.0 from ../node_modules/unimodules-constants-interface/ios
 unimodules-core@6.0.0 from ../node_modules/@unimodules/core/ios
 unimodules-face-detector-interface@5.4.0 from ../node_modules/unimodules-face-detector-interface/ios
 unimodules-file-system-interface@5.4.0 from ../node_modules/unimodules-file-system-interface/ios
 unimodules-font-interface@5.4.0 from ../node_modules/unimodules-font-interface/ios
 unimodules-image-loader-interface@5.4.0 from ../node_modules/unimodules-image-loader-interface/ios
 unimodules-permissions-interface@5.4.0 from ../node_modules/unimodules-permissions-interface/ios
 unimodules-react-native-adapter@5.7.0 from ../node_modules/@unimodules/react-native-adapter/ios
 unimodules-sensors-interface@5.4.0 from ../node_modules/unimodules-sensors-interface/ios
 unimodules-task-manager-interface@5.4.0 from ../node_modules/unimodules-task-manager-interface/ios

Auto-linking React Native modules for target `igniteTesting`: RNCAsyncStorage, RNCMaskedView, RNGestureHandler, RNKeychain, RNScreens, react-native-safe-area-context, and react-native-splash-screen
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CocoaPods could not find compatible versions for pod "Flipper-RSocket":
  In snapshot (Podfile.lock):
    Flipper-RSocket (= 1.3.1, ~> 1.3)

  In Podfile:
    Flipper-RSocket (~> 1.3)

None of your spec sources contain a spec satisfying the dependencies: `Flipper-RSocket (~> 1.3), Flipper-RSocket (= 1.3.1, ~> 1.3)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Aborting run
An unexpected error was encountered. Please report it as a bug:
CocoaPodsError: Command `pod install` failed.
└─ Cause: pod exited with non-zero code: 31
Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2
Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3
    at CocoaPodsPackageManager._installAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:92213)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async CocoaPodsPackageManager.installAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:90176)
    at async runAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:106198)
    at async /Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:106284 {
  code: 'COMMAND_FAILED',
  cause: Error: pod exited with non-zero code: 31
      at ChildProcess.h (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:1073)
      at Object.onceWrapper (node:events:472:26)
      at ChildProcess.emit (node:events:365:28)
      at maybeClose (node:internal/child_process:1067:16)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
      ...
      at Object.spawnAsync [as default] (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:558)
      at CocoaPodsPackageManager._runAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:92995)
      at CocoaPodsPackageManager._installAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:90499)
      at CocoaPodsPackageManager.installAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:90187)
      at runAsync (/Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:106206)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async /Users/benstoh/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:106284 {
    pid: 46889,
    output: [
      '',
      'Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2\n' +
        'Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3\n'
    ],
    stdout: '',
    stderr: 'Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2\n' +
      'Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3\n',
    status: 31,
    signal: null
  },
  isPackageManagerError: true
}

(Use `node --trace-uncaught ...` to show where the exception was thrown)

My Solution:

cd ios // go to ur ios folder
pod intsall --repo-update
cd .. // back to root directory
npm install
derekgreenberg commented 3 years ago

@benson7667 I just updated ignite-cli to version 6.11.1 and was able to ignite a new app without issues.

Please run npx ignite-cli doctor and post the results here.

Rakov-Denis commented 3 years ago

TL;DR npm 7.x might be a problem. Possible solution: stick to npm 6.x for now

I had the same issue as @pepasibble with very similar output. Then I also figured out that ignite was not creating node_modules folder: It was going very fast from 3D-printing of React app step to Baking CocoaPods step and failing there. After that I cd'ed to semi created project and run npm i to see what happens and figured out npm could not resolve some dependencies related to react 17 I believe.

My problem was node version of 14.16.something, but also npm version was 7.1.1. Which was critical, I believe. Once I moved back to npm 6.14.13 and node 14.17 - works like charm

Maybe it will help anyone.

barbieri commented 2 years ago

Guys, please avoid running ruby (and bundler, and cocoapods) in rosetta2 as it will cause issues with ffi (as the ffi_c.bundle will be of incorrect architecture).

The actual fix for m1 so it runs natively is to fix LIBRARY_SEARCH_PATHS and remove arm64 from EXCLUDED_ARCHS. Take a look at https://github.com/react-native-community/react-native-template-typescript/issues/223 and https://github.com/facebook/react-native/commit/a1c445a39c580037ada4a5d194a0d2daef15a25a

it would be nice if someone fixes the boilerplate so ignite runs nice on m1.

jamonholmgren commented 2 years ago

@barbieri Apologies for how long it's taken me to respond here. Ignite should be working pretty well now on M1. Can you give it a go and let me know?

Thanks!

Jamon

(screenshot from my M1)

image
barbieri commented 2 years ago

hi @jamonholmgren, unfortunately I don't have a M1 anymore. I'll see if I can find someone to test, but seems to be working for you, so it's a great start :-)

cabelitos commented 2 years ago

Hey guys. I can confirm that this is running fine on Apple M1.

JPedroAmorim commented 2 years ago

Same, working fine on my M1.

mazenchami commented 2 years ago

Thank you @cabelitos & @JPedroAmorim for confirming Ignite is working well on Apple M1 machines. I just tested on a M1 and can confirm also. Closing this issue. Please feel free to open a new one if this issue still persists.

Ashraf-Ali-aa commented 1 year ago

I had the same issue, but following this guide resolved the issue https://dev.to/retyui/fix-a-pod-install-error-undefined-method-exist-for-fileclass-react-native-24ke