Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

496
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!