title: how to create NestJs grpc client
body: <p>am trying to create a <strong>NestJs</strong> gRPC client on docker env, but i always get this error when compiling</p>
  
  <pre><code>[Nest] 1076   - 2020-05-19 23:59:34   [ClientProxy] The invalid gRPC package (package not found)
  Error: The invalid gRPC package (package not found)
      at ClientGrpcProxy.createClients (/app/node_modules/@nestjs/microservices/client/client-grpc.js:188:45)
      at new ClientGrpcProxy (/app/node_modules/@nestjs/microservices/client/client-grpc.js:26:33)
      at Function.create (/app/node_modules/@nestjs/microservices/client/client-proxy-factory.js:22:24)
      at clients.map.item (/app/node_modules/@nestjs/microservices/module/clients.module.js:11:51)
      at Array.map (&lt;anonymous&gt;)
      at Function.register (/app/node_modules/@nestjs/microservices/module/clients.module.js:9:41)
      at Object.&lt;anonymous&gt; (/app/dist/src/modules/orders/orders.module.js:31:43)
      at Module._compile (module.js:653:30)
      at Object.Module._extensions..js (module.js:664:10)
      at Module.load (module.js:566:32)
  /app/node_modules/@nestjs/microservices/client/client-grpc.js:190
                  throw invalidPackageError;
                  ^
  
  Error: The invalid gRPC package (package not found)
      at ClientGrpcProxy.createClients (/app/node_modules/@nestjs/microservices/client/client-grpc.js:188:45)
      at new ClientGrpcProxy (/app/node_modules/@nestjs/microservices/client/client-grpc.js:26:33)
      at Function.create (/app/node_modules/@nestjs/microservices/client/client-proxy-factory.js:22:24)
      at clients.map.item (/app/node_modules/@nestjs/microservices/module/clients.module.js:11:51)
      at Array.map (&lt;anonymous&gt;)
      at Function.register (/app/node_modules/@nestjs/microservices/module/clients.module.js:9:41)
      at Object.&lt;anonymous&gt; (/app/dist/src/modules/orders/orders.module.js:31:43)
      at Module._compile (module.js:653:30)
      at Object.Module._extensions..js (module.js:664:10)
      at Module.load (module.js:566:32)
  </code></pre>
  
  <p>i have already tried reinstalling the packages (gRPC, @grpc/proto-loader and @nestjs/microservices), </p>
  
  <p>I get this problem when trying with both methods provided in docs </p>
  
  <p><strong>First Method</strong> with @Client decorator </p>
  
  <pre><code>    @Client({
          transport: Transport.GRPC,
          options: {
            package: 'app',
            protoPath: join(__dirname, '../../../../../../src/modules/orders/proto/app.proto'),
          },
      })
  
      private client : ClientGrpc
  
      private grpcService: IGrpcService;
  
      onModuleInit(){
         this.grpcService= this.client.getService&lt;IGrpcService&gt;('AppController')
      }
  </code></pre>
  
  <p><strong>Second Method</strong> using ClientModule in appmodule.ts </p>
  
  <pre><code>ClientsModule.register([{
              name:'TEST',
              transport: Transport.GRPC,
              options: {
                package: 'app',
                protoPath: join(__dirname, '../../../../src/modules/orders/proto/app.proto'),
              },
            }])
  </code></pre>
  
  <p><strong>Proto file</strong></p>
  
  <pre><code>syntax = "proto3";
  
  package role;
  
  service RoleService {
      rpc CheckPermission (StringMessage) returns (BooleanPayload) {}
      rpc AddPolicy (StringMessage) returns (BooleanPayload) {}
  }
  
  message StringMessage {
      repeated string params = 1;
  }
  
  message Role {
      string id = 1;
      string codeName = 2;
      string label = 3;
      string createdAt = 4;
      string updatedAt = 5;
  }
  
  message BooleanPayload {
      bool success = 1;
  }
  </code></pre>