【问题标题】:Installing watchman when having a non-standard homebrew install安装非标准自制软件时安装守望者
【发布时间】:2017-05-05 00:21:26
【问题描述】:

我正在使用需要 watchman 的 React Native。在运行react-native run-ios 时,我看到了这个错误。

watchman --no-pretty get-sockname returned with exit code=1, signal=null, 
stderr= 2017-05-05T08:17:49,256: [2110218240] while computing sockname: 
failed to create /usr/local/var/run/watchman/foo-state: No such file or directory

经过调查,似乎是由于没有安装标准的/usr/local/ homebrew 造成的。

他们有办法改变守望者使用的statedir吗?

【问题讨论】:

  • 为什么要安装非标准的自制软件?
  • 这不是我可以在我的工作站上更改的。

标签: homebrew watchman


【解决方案1】:

我能够通过创建目录并将目录的所有权授予我的用户来解决此问题。

sudo mkdir /usr/local/var/run/watchman/foo-state
sudo chown -R myusername /usr/local/var/run/watchman/foo-state

【讨论】:

  • 这个解决方案效果很好。 React Native 支持 env 变量来配置 --statefile 可能很有用。
【解决方案2】:

来自watchman --help

 --statefile=PATH       Specify path to file to hold watch and trigger state

所以我认为您需要使用--statefile 选项。

【讨论】:

  • 我不确定这会有什么帮助,因为这意味着编辑在 React Native 中运行包管理器的脚本。
【解决方案3】:

解决此问题的最安全方法是删除状态目录。运行rm -rf /usr/local/var/run/watchman/root-state。这为我解决了同样的问题。

【讨论】:

    猜你喜欢
    • 2021-07-20
    • 1970-01-01
    • 1970-01-01
    • 2020-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多