question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPM install for proto-gen-grpc-web: notarget No matching version found for protoc-gen-grpc-web@1.3.0.

See original GitHub issue

I am trying to install proto-gen-grpc-web by using this command npm i protoc-gen-grpc-web@1.3.0 But it doesn’t update to 1.3.0 and stays onto 1.2.1

npm ERR! code ETARGET npm ERR! notarget No matching version found for protoc-gen-grpc-web@1.3.0. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
AZbangcommented, Oct 15, 2021

Download cli tool with postinstall npm hook in your project, for example:

const path = require("path");

const VERSION = "1.3.0";
const DL_PREFIX = "https://github.com/grpc/grpc-web/releases/download/";

const EXT = process.platform == "win32" ? ".exe" : "";
const PLATFORM_NAME = process.platform === "win32" ? "windows" : process.platform;
const PLUGIN_NAME = "protoc-gen-grpc-web-" + PLATFORM_NAME + VERSION + EXT;
const PLUGIN_DIR = path.resolve(__dirname, "bin");
const PLUGIN = path.resolve(PLUGIN_DIR, PLUGIN_NAME);

module.exports = { EXT, PLUGIN_DIR, PLATFORM_NAME, PLUGIN_NAME, PLUGIN, DL_PREFIX, VERSION };
// Forked from https://github.com/hronro/protoc-gen-grpc-web-npm
// Grpc-web do not provide own npm package for code generation utility
// So we need install it from github :(

const fs = require("fs-extra");
const download = require("download");
const { DL_PREFIX, PLUGIN_DIR, VERSION, PLUGIN, EXT, PLATFORM_NAME } = require("./grpc-web-gen");

async function downloadPackage() {
  if (process.arch !== "x64") {
    throw new Error(`Unsupported arch: only support x86_64, but you're using ${process.arch}`);
  }

  await fs.ensureDir(PLUGIN_DIR);
  const execFilename = `protoc-gen-grpc-web-${VERSION}-${PLATFORM_NAME}-x86_64${EXT}`;
  const downloadUrl = DL_PREFIX + VERSION + "/" + execFilename;

  console.log("Downloading", downloadUrl);
  const buffer = await download(downloadUrl).catch((err) => {
    console.error(err.message);
    process.exit(1);
  });

  await fs.writeFile(PLUGIN, buffer);
  await fs.chmod(PLUGIN, "0755");
}

downloadPackage().catch((err) => {
  throw err;
});

Use it for child_process.exec

`grpc_tools_node_protoc --plugin=protoc-gen-grpc-web=${PLUGIN}`,
0reactions
sampajanocommented, Oct 16, 2021

@AsmaRahimAliJafri Thanks for the report and sorry for the trouble!

But sorry we don’t own the protoc-gen-grpc-web npm package nor do we currently maintain a npm package that deliveries the protoc-gen-grpc-web binary.

@AZbang’s comments sounds like a good workaround. Would that be something that works for you?

Going forward, if there continues to be a strong need, we could consider adopting something like that given there’s a way to make it work robustly on ALL platforms. But nothing planned at this moment yet 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Npm Error - No matching version found for - Stack Overflow
npm complains that there "is no matching version found", but it's clearly installed. Worked to change package.json to target `"^3.0.0" and then ...
Read more >
Npm "No matching version found" - Nexus Repository Manager
Once again, I am getting an error when I attempt install an npm package with NXRM npm-group that is configured as registry in...
Read more >
No matching version found for [Error LoopBack Solved]
npm WARN config cache-min This option has been deprecated in favor of '--prefer-offline'. npm ERR! code ETARGET npm ERR! notarget No matching ......
Read more >
semver - npm
semver(1) -- The semantic versioner for npm. Install. npm install semver. Usage. As a node module: const ...
Read more >
Prevent npm install for not supported Node.js versions
Use a local npm configuration to prevent users from installing your module/project with an unsupported Node.js version.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found