使用ProtoC V21.1从原始文件中生成JS文件
命令使用 -
protoc.exe --js_out=import_style=commonjs,binary:. employees.proto
错误 -
'protoc-gen-js' is not recognized as an internal or external command,
operable program or batch file.
使用的版本 -
protoc.exe --version
libprotoc 3.21.1
--js_out: protoc-gen-js: Plugin failed with status code 1.
Command used -
protoc.exe --js_out=import_style=commonjs,binary:. employees.proto
Error -
'protoc-gen-js' is not recognized as an internal or external command,
operable program or batch file.
Version Used -
protoc.exe --version
libprotoc 3.21.1
--js_out: protoc-gen-js: Plugin failed with status code 1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在以下问题下找到有关此错误的更多详细信息:
从proto noreferrer“ Protoc V21.1#127
如果您有兴趣使用其他包装来生成静态代码,则可以使用以下内容。
protobufjs-cli
安装:
用法:
在收到您遇到的错误后,我开始使用此软件包。我没有发现该问题(截至2024年6月)中提到的任何解决方案吸引人。
You can find more details on this error under the following issue:
Generate js file from proto file with protoc v21.1 #127
If you are interested in using a different package for generating static code then you can use the following.
protobufjs-cli
Installation:
Usage:
I started using this package after I got the error you got. I didn't find any of the solutions mentioned in the issue (as of June 2024) appealing.