Search code examples
react-nativeyarnpkg

Error: spawn pod ENOENT when running `yarn run install-pods`


I'm trying to set up react native on my machine and when running yarn run install-pods I get the following error.

$ ./cli.js installPods
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn pod ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pod',
  path: 'pod',
  spawnargs: [ 'install', '--project-directory=./hosts/native/ios' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
 musketeer % yarn run install-pods
yarn run v1.17.3
$ ./cli.js installPods
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn pod ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pod',
  path: 'pod',
  spawnargs: [ 'install', '--project-directory=./hosts/native/ios' ]
}
error Command failed with exit code 1. 

Solution

  • Try Running

    npx react-native doctor
    

    and it will show all common errors and try to fix them automatically