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.

Cannot install grpc-tools js package on ubuntu 18.04 with npm

See original GitHub issue

Problem description

I am trying to install grpc-tools package on ubuntu 18.04 with npm. But an error arises. On ubuntu 20.04 everything is ok. How to install it on ubuntu 18.04?

Reproduction steps

I have Dockerfile:

FROM ubuntu:18.04
RUN apt update && apt install -y --no-install-recommends nodejs npm
RUN npm config set strict-ssl false
RUN npm install grpc-tools@1.11.0

I build docker this way:

docker build .

Getting an error:

Step 4/4 : RUN npm install grpc-tools@1.11.0
 ---> Running in 77d9132ac6af
npm WARN deprecated node-pre-gyp@0.15.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

> grpc-tools@1.11.0 install /node_modules/grpc-tools
> node-pre-gyp install

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp ERR! install error 
node-pre-gyp ERR! stack Error: unable to get local issuer certificate
node-pre-gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1105:38)
node-pre-gyp ERR! stack     at emitNone (events.js:106:13)
node-pre-gyp ERR! stack     at TLSSocket.emit (events.js:208:7)
node-pre-gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:639:8)
node-pre-gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38)
node-pre-gyp ERR! System Linux 5.4.0-40-generic
node-pre-gyp ERR! command "/usr/bin/node" "/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /node_modules/grpc-tools
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! not ok 
unable to get local issuer certificate
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.
npm ERR! Linux 5.4.0-40-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "grpc-tools@1.11.0"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! grpc-tools@1.11.0 install: `node-pre-gyp install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the grpc-tools@1.11.0 install script 'node-pre-gyp install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grpc-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grpc-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grpc-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log
The command '/bin/sh -c npm install grpc-tools@1.11.0' returned a non-zero code: 1

Environment

  • Linux Ubuntu 18.04 amd64
  • Node version 8.10.0
  • Node installation method: apt
  • Package name and version grpc-tools@1.11.0

Additional context

Also on stackoverflow: https://stackoverflow.com/questions/67114242/how-to-install-grpc-tools-js-package-on-ubuntu-18-04-with-npm

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
murgatroid99commented, Apr 15, 2021

You are using an old version of Node, that might be part of the problem. Node 8 has been past end of life for almost a year.

0reactions
murgatroid99commented, May 20, 2021

Your original issue said that the installation succeeded on Ubuntu 20.04, but failed on Ubuntu 18.04. That’s not an issue with a file not existing on the server. And I don’t know how that XML file is generated, but it’s definitely not complete. You can open the URL from the error message yourself and see that the file exists.

A 500 error is an internal server error, and I don’t know why you would be getting that consistently from Cloudflare or Google Cloud Storage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install grpc-tools js package on ubuntu 18.04 with npm ...
The problem is that default node version in ubuntu 18.04 is too old. You can update node with: npm cache clean -f npm...
Read more >
node.js - Can't install grpc npm-package - Stack Overflow
For me the solution was to install grpc globally. npm install grpc -g.
Read more >
grpc-tools - npm
Tools for developing with gRPC on Node.js. ... Start using grpc-tools in your project by running `npm i ... Install. npm i grpc-tools...
Read more >
How to Install Node.js and npm on Ubuntu 18.04 - Linuxize
Npm is the default package manager for Node.js and the world's largest software registry. In this tutorial, we will show you several different ......
Read more >
grpc - Bountysource
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@grpc/grpc-js' imported from ... I am trying to install grpc-tools package on ubuntu 18.04 with npm .
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