0

I am using grpc with angular. My package.json:

{
  "name": "angular13",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.0.0-next.0",
    "@angular/common": "~13.0.0-next.0",
    "@angular/compiler": "~13.0.0-next.0",
    "@angular/core": "~13.0.0-next.0",
    "@angular/forms": "~13.0.0-next.0",
    "@angular/material": "^13.0.0",
    "@angular/platform-browser": "~13.0.0-next.0",
    "@angular/platform-browser-dynamic": "~13.0.0-next.0",
    "@angular/router": "~13.0.0-next.0",
    "@auth0/angular-jwt": "^5.0.2",
    "@improbable-eng/grpc-web": "^0.15.0",
    "@ngx-translate/core": "^14.0.0",
    "@ngx-translate/http-loader": "^7.0.0",
    "@popperjs/core": "^2.10.1",
    "@protobuf-ts/grpcweb-transport": "^2.0.6",
    "@protobuf-ts/runtime": "^2.0.6",
    "bootstrap": "^5.1.2",
    "bootstrap-icons": "^1.7.0",
    "google-protobuf": "^3.21.2",
    "grpc-web": "^1.4.2",
    "material-icons": "^1.3.0",
    "rxjs": "~7.4.0",
    "simple-keyboard": "^3.5.40",
    "simple-keyboard-layouts": "^3.1.297",
    "ts-protoc-gen": "^0.15.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.3.10",
    "@angular/cli": "~13.0.0",
    "@angular/compiler-cli": "~13.0.0-next.0",
    "@protobuf-ts/plugin": "^2.9.0",
    "@types/google-protobuf": "^3.15.6",
    "@types/jasmine": "~3.10.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~3.10.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "~4.4.3"
  }
}

I am running the following command to generate proto file

protoc --plugin=protoc-gen-ts="C:\Users\...\source\...\node_modules\.bin\protoc-gen-ts.cmd" --js_out="import_style=commonjs,binary:C:\Users\...\source\...\src\app\api\protos\generated" --ts_out="service=grpc-web:C:\Users\...\source\...\src\app\api\protos\generated" plc.proto

Getting this error:

Option "service=grpc-web" not recognized.

I reinstalled the associated npms ts-protoc-gen, google-protobuf, @types/google-protobuf and @improbable-eng/grpc-web but still not working. Thanks!

Tuvia Khusid
  • 792
  • 5
  • 15
  • 31

0 Answers0