Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

506
Vistas
auto generate GRPC file in Ubntu os and Nodejs ( typescript ) project

i have ubuntu os on my PC .

previous os was windows 10 .

i have a project nodejs and typescript .

now i want to use GRPC in my project. when i want to generate GRPC files i use this commend :

    const path = require('path');
const shell = require('shelljs');
const rimraf = require('rimraf');
// https://github.com/shelljs/shelljs/issues/469
process.env.PATH += (path.delimiter + path.join(process.cwd(), 'node_modules', '.bin'));

const PROTO_DIR = './../src/Utilities/GRPC/Protos';
const MODEL_DIR =  './../src/Utilities/GRPC/models';
const PROTOC_PATH = './../node_modules/grpc-tools/bin/protoc';
const PLUGIN_PATH =  './../node_modules/.bin/protoc-gen-ts_proto';

rimraf.sync(`${MODEL_DIR}/*`, {
  glob: { ignore: `${MODEL_DIR}/tsconfig.json` },
});

const protoConfig = [
  `--plugin=${PLUGIN_PATH}`,

  // https://github.com/stephenh/ts-proto/blob/main/README.markdown
  "--ts_proto_opt=outputServices=grpc-js,env=node,useOptionals=true,exportCommonSymbols=false,esModuleInterop=true",

  `--ts_proto_out=${MODEL_DIR}`,
  `--proto_path ${PROTO_DIR} ${PROTO_DIR}/*.proto`,
];
// https://github.com/stephenh/ts-proto#usage
shell.exec(`${PROTOC_PATH} ${protoConfig.join(" ")}`, (code, stdout, stderr) => console.log(code, stdout, stderr));

now when i run this command it show me this error :

/bin/sh: 1: ./../node_modules/grpc-tools/bin/protoc: not found
127  /bin/sh: 1: ./../node_modules/grpc-tools/bin/protoc: not found

but when i use this command in windows it work correct .

whats the problem ? how can i sovle this problem ?

this my package.json :

"grpc_tools_node_protoc_ts": "^5.3.2",
"grpc-tools": "^1.11.2",
"google-protobuf": "^3.19.3",
"@grpc/grpc-js": "^1.4.5",
"@grpc/proto-loader": "^0.6.9",
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda