Ionic 4 协议缓冲区

Ionic 4 Protocol Buffer

您好,我有一个 Ionic 项目,需要使用 Protocol Buffer。但是我找不到任何资源或教程。我在 Whosebug Protocol Buffers in Ionic

上发现了这个问题

我也关注这个https://golb.hplar.ch/2017/01/Consume-Protocol-Buffer-messages-in-Ionic-2.html

但是它给出了一个错误。

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! proto-buff@0.0.1 pbts: `pbjs -t static-module ../server/src/main/protobuf/Earthquake.proto -o src/app/protos/earthquake.js && pbts --no-comments src/app/protos/earthquake.js -o src/app/protos/earthquake.d.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the proto-buff@0.0.1 pbts script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ozer0\AppData\Roaming\npm-cache\_logs20-03-28T18_46_04_909Z-debug.log

这是错误。

有ionic 4的protocol buffer资源吗,非常感谢

https://golb.hplar.ch/2017/01/Consume-Protocol-Buffer-messages-in-Ionic-2.html 我想这个教程指出了所有要点。

../server/src/main/protobuf/Earthquake.proto

检查Earthquake.proto是否在此路径中的位置。如果您修复它,它将起作用。