Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc causing npm install failure on Linux #780

Closed
apaatsio opened this issue May 7, 2018 · 9 comments · Fixed by #785
Closed

grpc causing npm install failure on Linux #780

apaatsio opened this issue May 7, 2018 · 9 comments · Fixed by #785

Comments

@apaatsio
Copy link

apaatsio commented May 7, 2018

Describe your environment

  • Operating System version: Manjaro Linux
  • Firebase SDK version: 4.13.1
  • Node: 10.0.0
  • NPM: 5.6.0

Describe the problem

npm install firebase fails when it's trying to install grpc.

I understand that this is probably a grpc problem. firebase has dependency on [email protected] which fails to install even when I try to install it separately with npm install [email protected].

However, the most recent version ([email protected]) installs without problems. So, if firebase updated the dependency from [email protected] to [email protected] I think it would solve this problem.

Error output:

> [email protected] install /tmp/test/node_modules/@firebase/firestore/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-linux-x64-glibc.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp) 
Traceback (most recent call last):
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 514, in gyp_main
    options.duplicate_basename_check)
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 130, in Load
    params['parallel'], params['root_targets'])
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2778, in Load
    variables, includes, depth, check, True)
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 394, in LoadTargetBuildFile
    includes, True, check)
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 266, in LoadOneBuildFile
    aux_data, includes, check)
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 304, in LoadBuildFileIncludesIntoDict
    subdict_path, include)
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2144, in MergeDicts
    MergeDicts(to[k], v, to_file, fro_file)
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2137, in MergeDicts
    to[k] = MakePathRelative(to_file, fro_file, v)
  File "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2036, in MakePathRelative
    if item[-1] == '/':
IndexError: string index out of range while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Linux 4.16.7-1-MANJARO
gyp ERR! command "/home/antti/.nvm/versions/node/v10.0.0/bin/node" "/home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/tmp/test/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/tmp/test/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc"
gyp ERR! cwd /tmp/test/node_modules/@firebase/firestore/node_modules/grpc
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/home/antti/.nvm/versions/node/v10.0.0/bin/node /home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/tmp/test/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/test/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/tmp/test/node_modules/@firebase/firestore/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:947:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
node-pre-gyp ERR! System Linux 4.16.7-1-MANJARO
node-pre-gyp ERR! command "/home/antti/.nvm/versions/node/v10.0.0/bin/node" "/tmp/test/node_modules/@firebase/firestore/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /tmp/test/node_modules/@firebase/firestore/node_modules/grpc
node-pre-gyp ERR! node -v v10.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok 
Failed to execute '/home/antti/.nvm/versions/node/v10.0.0/bin/node /home/antti/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/tmp/test/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/test/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc' (1)
npm WARN enoent ENOENT: no such file or directory, open '/tmp/test/package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

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!     /home/antti/.npm/_logs/2018-05-07T14_53_48_294Z-debug.log
@google-oss-bot
Copy link
Contributor

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

@google-oss-bot
Copy link
Contributor

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

@apaatsio
Copy link
Author

apaatsio commented May 7, 2018

If someone else is having the same problem, the quick fix is to revert back to node 9 from node 10.

@mmermerkaya
Copy link
Contributor

Another quick fix is to use Yarn to install. I tried this on Manjaro + Node 10 with both NPM 6.0.0 and Yarn 1.6.0, and it only fails with NPM.

@rsgowman
Copy link
Member

There's (at least) two issues here:

  1. There isn't a binary build of grpc 1.10.1 for npm ABI 64. Reverting to node 9.x (as mentioned above) should address that, as it uses the previous ABI.
  2. The source build (which triggers when the binary build can't be found) seems to be failing. I (mostly) can't reproduce this locally, but did notice this: Build error when run from npm script nodejs/node-gyp#1217. tl;dr: check your npm config for scripts-prepend-node-path=false. (npm config list). If I set that locally, my build also fails in an identical manner. Maybe that's happening for your build too?

@unseen1980
Copy link

Hi, I had exactly the same issue in my vsts ci/cd. I was always using a windows hosted agent for my build and yesterday I noticed that my deployment failed with exactly the same error. From the log I saw that this agent uses Node version 10 which is not compatible with grpc 1.10.1. What worked for me at least for now was to use a linux agent which is still in Node version 8.x.

@franjorub
Copy link

Using version 9.11 of node I was able to install grpc without problems with firebase

@JustinPlute
Copy link

Why is this issue closed? Reverting back to an older version of Node.js is a work-a-round, not a fix.

@rsgowman
Copy link
Member

rsgowman commented Sep 3, 2019

I've long since lost whatever context I once had on this issue. But reading back I think:

  • The original problem was in grpc 1.10.x.
  • The problem disappeared in 1.11.x.
  • Firebase was updated to use 1.11.x.

So I don't think this should be an issue anymore. However, if you're still seeing it, please open a new issue and refer back to this one.

@firebase firebase locked and limited conversation to collaborators Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants