grpc-node icon indicating copy to clipboard operation
grpc-node copied to clipboard

npm ERR! Failed at the [email protected] install script.

Open huturen opened this issue 6 years ago • 59 comments

Error as below:

npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-10-09T11_59_21_558Z-debug.log
Task quited with error: Task end with error: Error: Command failed: npm --registry=http://r.npm.oa.com install --production In file included from ../deps/grpc/third_party/upb/upb/msg.h:14:0, from ../deps/grpc/third_party/upb/upb/generated_util.h:10, from ../deps/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h:12, from ../deps/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.h:29, from ../deps/grpc/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h:26, from ../deps/grpc/src/core/lib/security/credentials/alts/alts_credentials.h:26, from ../deps/grpc/src/core/lib/security/credentials/alts/alts_credentials.cc:21: ../deps/grpc/third_party/upb/upb/upb.h:27:28: fatal error: upb/port_def.inc: No such file or directory compilation terminated. make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/alts/alts_credentials.o] Error 1 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 3.10.107-1-tlinux2-0048 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=~/dataServer/dataServer/src/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=~/dataServer/dataServer/src/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64" gyp ERR! cwd ~/dataServer/dataServer/src/node_modules/grpc gyp ERR! node -v v10.16.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=~/dataServer/dataServer/src/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=~/dataServer/dataServer/src/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) node-pre-gyp ERR! stack at ChildProcess. (~/dataServer/dataServer/src/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) node-pre-gyp ERR! System Linux 3.10.107-1-tlinux2-0048 node-pre-gyp ERR! command "/usr/local/bin/node" "~/dataServer/dataServer/src/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library" node-pre-gyp ERR! cwd ~/dataServer/dataServer/src/node_modules/grpc node-pre-gyp ERR! node -v v10.16.0 node-pre-gyp ERR! node-pre-gyp -v v0.13.0 node-pre-gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-10-09T11_59_21_558Z-debug.log (2)

dependency tree like below:

➜  DataServer git:(master) ✗ npm ls grpc 
[email protected] ~/DataServer
└─┬ @lag/[email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected] 

huturen avatar Oct 09 '19 12:10 huturen

Fixed it after degrading to "grpc": "1.23.3"

 "dependencies": {
  ...
  "grpc": "1.23.3",
  ...
}

➜  DataServer git:(master) ✗ npm ls grpc 
[email protected] ~/DataServer
├─┬ @lag/[email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected]  deduped
└── [email protected] 

huturen avatar Oct 09 '19 12:10 huturen

I got similar error for installing [email protected] during npm install --save firebase. I just upgrade NodeJS version from v8* to latest v10 and problem solved.

nuri-engin avatar Oct 13 '19 13:10 nuri-engin

I got similar error for installing [email protected] during npm install --save firebase. I just upgrade NodeJS version from v8* to latest v10 and problem solved.

@nuri-engin I got this error on NodeJS version v10.16.0.

Maybe a bug has occurred since version [email protected].

huturen avatar Oct 15 '19 09:10 huturen

any updates?

SmirnovM91 avatar Oct 15 '19 10:10 SmirnovM91

I got similar error for npm install --save firebase Linux 4.4.0-101-generic node v11.12.0 npm v6.7.0

mdenissov avatar Oct 16 '19 11:10 mdenissov

I got same error when tried npm install My local enviroment is

  • macOS Mojave version 10.14.6
  • node v10.16.0
  • npm v6.12.0

Who know how to solve this error ???

Katsukiniwa avatar Oct 16 '19 12:10 Katsukiniwa

Same issue on my side while installing latest Firebase ...

scriptPilot avatar Oct 16 '19 14:10 scriptPilot

same issue on my end and its failing on my heroku build.

crudexec avatar Oct 28 '19 05:10 crudexec

I fixed this error by downgrading my node version from the latest (13.1.0) to 12.13.0

micah-akpan avatar Nov 14 '19 13:11 micah-akpan

This error is gone for me without up/downgrading anything I bet it's something about some bundles downloaded while it installs, so it's basically an infrastructure issue.

matheo avatar Nov 15 '19 22:11 matheo

Any other solutions? I'm still facing this issue. I have node v12.13.0 downgraded dependencies of grpc @1.23.3 This happened for me as well after upgrading to the latest firebase-tools

VincentMRA avatar Nov 22 '19 02:11 VincentMRA

Any updates, same issue node version 10.17.0 and version 12.13.1 :(

santhoshlfms avatar Nov 26 '19 06:11 santhoshlfms

Same issue. Just use Yarn

konradsofton avatar Nov 27 '19 15:11 konradsofton

Same issue with [email protected]... downgraded to [email protected] but still getting the error

AprilPolubiec avatar Dec 04 '19 18:12 AprilPolubiec

Delete the old node_modules and package.lock.json and then install the latest version for firebase. Hope this would help you. :)

jhimy-michel avatar Dec 05 '19 16:12 jhimy-michel

Same issue with node v12.9.1 Having issue only in google cloud build during integration tests. As a temporary solution skip test.

DmytroMysak avatar Dec 08 '19 18:12 DmytroMysak

Same issue with node v13.5

shahbazhaidry avatar Dec 31 '19 09:12 shahbazhaidry

Delete the old node_modules and package.lock.json and then install the latest version for firebase. Hope this would help you. :)

Done it several times. Couldn't find the solution :disappointed:

yasirjanjua avatar Jan 06 '20 08:01 yasirjanjua

I have used Yarn instead.

In the folder of my package, where the error was occurring when using npm link

I just deleted the node_modules and package.lock.json and did the following steps:

yarn

yarn build

then

yarn link

all of it worked well.

frederikocmr avatar Jan 08 '20 04:01 frederikocmr

was having trouble with Firebase cuz firebase needs grpc, so I went to package.json and updated firebase version to the current latest version "7.7.0". Yarn install and I don't see this error anymore

StanfordLin avatar Jan 20 '20 22:01 StanfordLin

same issue no solution worked

waqaramjad avatar Feb 10 '20 13:02 waqaramjad

I fixed this error by using node v8.17.0

DaniPB avatar Feb 12 '20 05:02 DaniPB

Same issue with [email protected] [email protected]

scolcoin avatar Feb 19 '20 22:02 scolcoin

Any updates on this issue?

itzzmeakhi avatar Feb 20 '20 06:02 itzzmeakhi

I try to cejecutar hyper fabric 1.4.4 and I have tried several versions of npm and node recommended by the system but the grpc is a problem. at the time of mounting the fabcar npm install the following error comes up npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file sh npm ERR! errno ENOENT npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build --library=static_library npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the [email protected] install script.

I also update and this error comes out: npm install --save firebase npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file sh npm ERR! errno ENOENT npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build --library=static_library npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. help please!

scolcoin avatar Feb 20 '20 12:02 scolcoin

Downgrade the version of Node js

JanuaryThomas avatar Feb 26 '20 10:02 JanuaryThomas

I found that the problem was that the package request was missing. Installing it before installing grpc fixed my issues. If you have a package depending on grpc, install request first.

yarn add request yarn add grpc

A colleague mentioned that the package "spike" is used if request is not available and that doesn't play nice with the company proxy. Dunno if that's actually the problem, but adding request did fix the issue.

MrEmanuel avatar Feb 27 '20 13:02 MrEmanuel

Downgrade the version of Node js

This worked for me. Mac OS Catalina and react-native project

rupal-simform avatar Mar 03 '20 15:03 rupal-simform

Delete the old node_modules and package.lock.json and then install the latest version for firebase. Hope this would help you. :)

Done it several times. Couldn't find the solution 😞

work for me..

AndrianD avatar Mar 09 '20 21:03 AndrianD

First off, please do not upgrade/ downgrade your global environment libraries simply because a single library refuses to play nicely, save that as a super-last resort...

Try this:

  1. Remove the lock file and the node_modules directory
rm -rfv package-lock.json node_modules
  1. get the latest version of firebase
npm install --save-exact --save firebase@latest

at the time of writing this, the latest version of firebase was 7.10.0

  1. check for vulnerabilities
npm audit fix
  1. then run install
npm install

It worked for me with this combination:

node version: v13.7.0
npm version: 6.13.6

hth anyone who is still struggling...

reymalahay avatar Mar 10 '20 08:03 reymalahay