【问题标题】:the command `brew install watchman` runs `chmod` but fails to install eventually命令 `brew install watchman` 运行 `chmod` 但最终无法安装
【发布时间】:2015-08-19 21:20:34
【问题描述】:
brew install --HEAD watchman
==> Cloning https://github.com/facebook/watchman.git
Updating /Library/Caches/Homebrew/watchman--git
==> Checking out branch master
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/watchman/HEAD --with-pcre
==> make
==> make install
install: chmod 777 /: Operation not permitted
touch //.not-empty
touch: //.not-empty: Permission denied
make[1]: *** [install-exec-local] Error 1
make: *** [install-am] Error 2
couldn't understand kern.osversion `14.5.0'

READ THIS: https://git.io/brew-troubleshooting

它正在尝试chmod 777 /,这不好。为什么要这样做?感觉不应该被允许。我尝试卸载 watchman 并使用此命令重新安装以使 react-native 开始工作。

这里的步骤:https://github.com/facebook/react-native/issues/239

https://facebook.github.io/react-native/docs/troubleshooting.html

【问题讨论】:

    标签: reactjs facebook react-native homebrew watchman


    【解决方案1】:
    brew uninstall watchman
    sudo chown -R `whoami` /usr/local
    brew link pcre
    brew install watchman
    

    【讨论】:

    • 在 High sierra 或更高版本中,sudo sudo chown -R `whoami` /usr/local 将失败。有人可能想改用sudo chown -R $(whoami) $(brew --prefix)/*
    【解决方案2】:

    好的解决了

    您可以在不使用 --HEAD 选项的情况下安装 watchman(当前跟踪的 watchman 版本已经足够老,没有指定问题)。因此,只需执行 brew install watchman 即可。

    如果您的 react 项目出现问题,请确保您的项目目录是 git repo(如果不是,请运行 git init)参见:

    https://github.com/facebook/react-native/issues/2032

    https://github.com/facebook/react-native/issues/2042

    【讨论】:

      【解决方案3】:

      【讨论】:

        【解决方案4】:

        修复在 OSX 上安装 high sierra 10.13.2 需要重新安装自制软件,因为它需要解决不可写的 /usr/local/ 文件夹

        我不得不重新安装自制软件:

        卸载:

        ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 重新安装:

        ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

        【讨论】:

          【解决方案5】:

          试试

          brew update
          brew doctor
          brew install watchman
          

          如果您仍然遇到问题,请尝试转到 your_project/node_modules/react-native/packager/react-packager/src/FileWatcher/index.js 并增加 MAX_WAIT_TIME

          【讨论】:

            【解决方案6】:

            对我来说和上面一样:

            brew update
            brew doctor
            brew install watchman
            

            还要确保你在 jest 配置中有这个:

            watchPathIgnorePatterns: ['node_modules']
            

            【讨论】:

              猜你喜欢
              • 2023-02-06
              • 1970-01-01
              • 2017-06-07
              • 2021-10-04
              • 2019-08-07
              • 1970-01-01
              • 2021-01-27
              • 2014-09-28
              • 2017-01-19
              相关资源
              最近更新 更多