【问题标题】:Error: spawn pod ENOENT when running `yarn run install-pods`错误:运行 `yarn run install-pods` 时产生 pod ENOENT
【发布时间】:2020-05-18 13:01:24
【问题描述】:

我正在尝试在我的机器上设置 react native,在运行 yarn run install-pods 时出现以下错误。

$ ./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. 

【问题讨论】:

  • 尝试 brew install cocoapods 然后 brew link --overwrite cocoapods

标签: react-native yarnpkg


【解决方案1】:

尝试运行

npx react-native doctor

它会显示所有常见错误并尝试自动修复它们

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-20
    • 2018-05-27
    • 1970-01-01
    • 2019-11-21
    • 1970-01-01
    • 2013-07-30
    • 2017-03-26
    相关资源
    最近更新 更多