为什么在处理用curl下载的文件时'unzip protoc-21.4-osx-universal_binary.zip'会失败

hgc7kmma  于 2022-11-13  发布在  其他
关注(0)|答案(1)|浏览(130)

我正在学习如何在Macbook Pro/ macOS Big Sur / 11.6.8上使用gRPC和GOLANG,使用Protocol Buffer Compiler Installation页面上的说明,其中指示读者使用curl下载protoc编译器归档文件,并使用unzip扩展归档文件。我正在执行以下命令序列:

curl -LO https://github.com/protocolbuffers/protobuf/releases/protoc-21.4-osx-universal_binary.zip
unzip protoc-21.4-osx-universal_binary.zip -d /Users/rodrigosilveira/.local

解压缩执行失败,并显示以下消息:

Archive:  protoc-21.4-osx-universal_binary.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of protoc-21.4-osx-universal_binary.zip or
        protoc-21.4-osx-universal_binary.zip.zip, and cannot find protoc-21.4-osx-universal_binary.zip.ZIP, period.

调试说明
不使用curl即可解压缩

0dxa2lsx

0dxa2lsx1#

此实用程序的当前URL为

https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-osx-universal_binary.zip

前一个返回“Not found”,这就是您得到此zip错误的原因

相关问题