0

Trying to use google protocol buffer in my node.js web server with this documentation.

When running the following command:

protoc --js_out=import_style=commonjs,binary: ServiceMessage.proto

I received:

--js_out: : Unknown option: import_style

Any suggestions?

Cheers, Itay

ItayB
  • 10,377
  • 9
  • 50
  • 77
  • @zangw You suggest a different module, I'll give it a try and update. Thanks! – ItayB Mar 22 '16 at 14:32
  • 1
    Per this [discussion](https://github.com/google/protobuf/pull/1215), this feature is added recently, does protoc you used is latest verion? – zangw Mar 22 '16 at 14:46
  • @zangw libprotoc 3.0.0 – ItayB Mar 22 '16 at 14:50
  • 1
    Version 3.0.0 is released in 2015-12-30, you may get the latest codes of protobuf... – zangw Mar 22 '16 at 14:55
  • I've download the version from here: https://github.com/google/protobuf/releases it's the newest beta :-( – ItayB Mar 22 '16 at 14:58
  • 1
    Per this [commit history](https://github.com/google/protobuf/commit/24c5424be5b220d8d4575e4262ee5d6ad9417959), it is changed at Feb 20, I think you should update your codes with latest one. – zangw Mar 22 '16 at 15:04
  • @zangw That's work! I've download the source, configure / make / sudo make install and use the '.' as you suggested. Thanks! – ItayB Mar 22 '16 at 15:36

1 Answers1

1

Per this discussion line, the js_out is added recently and merge at Feb 20, you may updated your protoc with latest codes from protobuf.

zangw
  • 43,869
  • 19
  • 177
  • 214