Why am I unable to use glog due to incorrect hash?

2019-08-29 12:19发布

问题:

Related to my question on ReactNative init setup process being awful, I am unable to download glog due to an incorrect hash. Does anyone know what is going on here? How can I fix this so that I can use react-native properly? I have tried clearing my entire .rncache and it did nothing.

It does look like glog-0.3.5 is the most recent version... so why am I having a nightmare of a time using this? Why is the hash incorrect? Does ReactNative install something with a different hash than it is supposed to?

Incorrect hash:

61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc ?/Users/me/.rncache/glog-0.3.5.tar.gz

Retrying...

Failed to successfully download 'glog-0.3.5.tar.gz'. Debug info:

-rw-r--r-- 1 root staff 532275 Feb 15 18:24 /Users/me/.rncache/glog-0.3.5.tar.gz

61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc /Users/me/.rncache/glog-0.3.5.tar.gz

Command PhaseScriptExecution failed with a nonzero exit code

回答1:

My error was located a bit above yours in the console.

Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib

I fixed this by symlinking to the version I had.

ln -s /usr/local/opt/readline/lib/libreadline.7.dylib /usr/local/opt/readline/lib/libreadline.6.dylib

If the lib does not exists and you are using Mac you can use a custom brash with brew. https://itnext.io/upgrading-bash-on-macos-7138bd1066ba



回答2:

Actually @FOLOG's suggestion, while working, was a bit of a ghetto fix. I encountered this issue and went to dig a little further and found the culprit to be gawk.

The clue is here: Referenced from: /usr/local/bin/awk

Assuming you are on Mac, just run brew upgrade gawk to fix the problem.