【问题标题】:watchman warning in react native app running through expo通过博览会运行的本机应用程序中的守​​望者警告
【发布时间】:2019-12-15 17:48:32
【问题描述】:

在使用 expo 运行 react 本机应用程序时,我在 watchman 上收到此警告。

watchman warning:  opendir(/Users/saashwath/Library/Caches/CloudKit/com.apple.Safari) -> Operation not permitted. Marking this portion of the tree deleted
To clear this warning, run:
watchman watch-del /Users/saashwath ; watchman watch-project /Users/saashwath

如何删除此警告。提前致谢:)

【问题讨论】:

    标签: reactjs react-native expo watchman


    【解决方案1】:

    有东西要求 watchman 监视您的主目录 /Users/saashwath,但 watchman 进程无法访问目录 /Users/saashwath/Library/Caches/CloudKit/com.apple.Safari

    这有时可能是因为在 sudo 下运行的某些内容恰好现在由 root 拥有,或者,更有可能在 macOS 上,您不允许 watchman 进程在 macOS 时访问 homedir 中的某些目录抛出了一些提示,如此 GitHub 问题中所示:https://github.com/facebook/watchman/issues/658

    现在,让 watchman 监视你的主目录通常没有多大意义,所以我建议运行这个来取消那个 watch:

    watchman watch-del /Users/saashwath
    

    除非明确要求,否则 Watchman 通常不会观看该位置,但在某些情况下,它可能会决定在看起来像项目边界的地方聚合观看的项目。在默认配置中,如果您碰巧使用 git 来跟踪主目录中的点文件,这将使您的主目录成为监视聚合的有效位置。

    我通常建议不要让 git 尝试管理您的整个主目录,即使在这个守望者相关问题之外!但是,您也可以将 watchman 安装配置为更具限制性。

    如果您将以下内容部署到/etc/watchman.json

    {
      "root_files": [".watchmanconfig"]
    }
    

    并重新启动 watchman (watchman shutdown-server ; watchman watch-list),那么 watchman 将仅将其中包含 .watchmanconfig 文件的项目视为有效的可监视项目。

    我相信 React Native 会在你设置它时在应用程序的适当位置创建一个.watchmanconfig,但如果它没有,你需要在该文件中创建一个空的 json 对象来设置顶一下:

    echo '{}' > /my/react/project/.watchmanconfig
    

    这将确保您的项目是可观看的。

    【讨论】:

      【解决方案2】:

      需要从系统偏好设置>安全和隐私>隐私>全盘访问>并标记检查具有管理员访问权限的守望者

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-08-08
        • 2017-03-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多