网站制作学习网Linux→正文:protoc-gen-grpc-web: program not found or is not executable
字体:

protoc-gen-grpc-web: program not found or is not executable

Linux 2023/10/26 12:40:08  点击:不统计


 
写代码用到grpc 相关,运行命令时 出现 
protoc-gen-grpc-web: program not found or is not executable
--grpc-web_out: protoc-gen-grpc-web: Plugin failed with status code 1.


这个错误表明 protoc 无法找到 protoc-gen-grpc-web 插件。你需要安装这个插件并确保它在你的 PATH 环境变量中。
以下是在 Unix-like 系统(如 Linux 或 macOS)上安装 protoc-gen-grpc-web 插件的步骤:
1. 下载插件的预编译二进制文件。你可以在 grpc-web 的 GitHub 仓库的 https://github.com/grpc/grpc-web/releases 页面 找到它。
 
2. 将下载的文件移动到一个在你的 PATH 中的目录,例如 /usr/local/bin。你可能需要使用 sudo 来获取必要的权限。例如:
   sudo mv ~/Downloads/protoc-gen-grpc-web-1.2.1-linux-x86_64 /usr/local/bin/protoc-gen-grpc-web

3. 使文件可执行。例如:
   sudo chmod +x /usr/local/bin/protoc-gen-grpc-web
然后,你应该能够运行 protoc --grpc-web_out=... 命令了。
如果你仍然遇到问题,可能需要检查你的 PATH 环境变量,或者尝试在 protoc 命令中使用插件的完整路径,
例如 protoc --plugin=protoc-gen-grpc-web=/path/to/protoc-gen-grpc-web --grpc-web_out=...。
 
转自网络,忘记地址了,当时复制下来的~
 

转www.载for网站制作学习asp必.cn究

·上一篇:shell nohup 获取进程号 >>    ·下一篇:docker 安装 >>
推荐文章
最新文章