grpc-node
grpc-node copied to clipboard
Cannot install grpc-tools js package on ubuntu 18.04 with npm
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 [email protected]
I build docker this way:
docker build .
Getting an error:
Step 4/4 : RUN npm install [email protected]
---> Running in 77d9132ac6af
npm WARN deprecated [email protected]: 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
> [email protected] 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" "[email protected]"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-pre-gyp install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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 [email protected]' 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 [email protected]
Additional context
Also on stackoverflow: https://stackoverflow.com/questions/67114242/how-to-install-grpc-tools-js-package-on-ubuntu-18-04-with-npm
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.
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.
@murgatroid99 Thanks, that solves the problem. Updated with:
npm cache clean -f
npm install -g n
n stable
Hello, there is still a problem.
Despite it does work, it doesn't work under corporate proxy. Most probably this is not an issue with grpc-tools, but could you please take a look?
While trying to install grpc-tools 1.9.0 under corporate proxy the error arises: Node.js: Error: 500 status code downloading tarball
https://stackoverflow.com/questions/67127855/node-js-error-500-status-code-downloading-tarball
A 500 error should be temporary. Wait a bit and try again.
Unfortunately it is not temporrarily and is reproduced always. I see that here https://node-precompiled-binaries.grpc.io/ 1.6.6 is present, but 1.9.0 is not
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.