React Native 命令'brew install watchman'运行'chmod',但最终安装失败

inn6fuwd  于 2022-11-17  发布在  React
关注(0)|答案(7)|浏览(279)
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

bkkx9g8r

bkkx9g8r1#

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

ijxebb2r2#

好的,修好了
你可以不使用--HEAD选项安装watchman(当前跟踪的watchman版本已经很老了,没有指定的问题)。
如果你的react项目出现问题,确保你的项目目录是git repo(如果不是,运行git init),请参见:
https://github.com/facebook/react-native/issues/2032
https://github.com/facebook/react-native/issues/2042

lf5gs5x2

lf5gs5x24#

修复在OSX high sierra 10.13.2上安装需要重新安装homebrew,因为它需要解决不可写的/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)"

hgc7kmma

hgc7kmma5#

尝试

brew update
brew doctor
brew install watchman

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

dojqjjoe

dojqjjoe6#

对我来说,工作和上面一样:

brew update
brew doctor
brew install watchman

还要确保在jest配置中包含以下内容:

watchPathIgnorePatterns: ['node_modules']
rks48beu

rks48beu7#

使用新M1、M2 macbook的用户使用arch -x86_64 brew install <package>

相关问题