简体   繁体   English

命令“brew install watchman”运行“chmod”但最终安装失败

[英]the command `brew install watchman` runs `chmod` but fails to install eventually

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

It is trying to chmod 777 / which is not good.它正在尝试chmod 777 /这不好。 Why is it trying to do that?为什么要这样做? Feels like that shouldn't be allowed.感觉不应该被允许。 I tried to uninstall watchman and reinstall with this command to get a react-native to start working.我尝试卸载 watchman 并使用此命令重新安装以获取 react-native 以开始工作。

Followed steps here: https://github.com/facebook/react-native/issues/239按照此处的步骤操作: https://github.com/facebook/react-native/issues/239

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

brew uninstall watchman
sudo chown -R `whoami` /usr/local
brew link pcre
brew install watchman

Ok fixed it好的修复了它

You can install watchman without the --HEAD option (the currently tracked version of watchman is old enough to not have the issue specified).您可以在没有 --HEAD 选项的情况下安装 watchman(当前跟踪的 watchman 版本足够旧,没有指定问题)。 So just do a brew install watchman.所以只需做一个 brew install watchman。

If you then get issues with your react project make sure that your project directory is a git repo (run git init if not) see:如果您的 React 项目出现问题,请确保您的项目目录是 git repo(如果不是,请运行 git init),请参阅:

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

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

Fix for installing on OSX high sierra 10.13.2 required reinstalling homebrew since it needs to work around the non-writeable /usr/local/ folder修复在 OSX high sierra 10.13.2安装需要重新安装自制软件,因为它需要解决不可写的/usr/local/文件夹

I had to reinstall homebrew:我不得不重新安装自制软件:

uninstall:卸载:

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

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

Try尝试

brew update
brew doctor
brew install watchman

If you are still having problems, try going to your_project/node_modules/react-native/packager/react-packager/src/FileWatcher/index.js and increase the MAX_WAIT_TIME如果您仍然遇到问题,请尝试转到 your_project/node_modules/react-native/packager/react-packager/src/FileWatcher/index.js 并增加 MAX_WAIT_TIME

For me worked the same as above:对我来说和上面一样工作:

brew update
brew doctor
brew install watchman

Also make sure you have this in the jest config:还要确保你在 jest 配置中有这个:

watchPathIgnorePatterns: ['node_modules']

People on new M1, M2 macbooks use arch -x86_64 brew install <package>新 M1、M2 macbook 上的人使用arch -x86_64 brew install <package>

For me, running the following command worked:对我来说,运行以下命令有效:

brew install --HEAD watchman

For more information do consult the official documentation Watchman documentation from Facebook有关更多信息,请参阅来自 Facebook 的官方文档 Watchman 文档

守望者文档的屏幕截图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM