Firebase-tools: grpc installation issues

Created on 22 Sep 2017  ·  18Comments  ·  Source: firebase/firebase-tools

npm WARN deprecated [email protected]: Use uuid module instead
/usr/bin/firebase -> /usr/lib/node_modules/firebase-tools/bin/firebase

[email protected] install /usr/lib/node_modules/firebase-tools/node_modules/grpc
node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-v57-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/firebase-tools/node_modules/grpc/build'
gyp ERR! System Linux 4.10.0-35-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/usr/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node" "--module_name=grpc_node" "--module_path=/usr/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary"
gyp ERR! cwd /usr/lib/node_modules/firebase-tools/node_modules/grpc
gyp ERR! node -v v8.5.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 '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node --module_name=grpc_node --module_path=/usr/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/lib/node_modules/firebase-tools/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:927:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.10.0-35-generic
node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/firebase-tools/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/lib/node_modules/firebase-tools/node_modules/grpc
node-pre-gyp ERR! node -v v8.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node --module_name=grpc_node --module_path=/usr/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/firebase-tools/node_modules/grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-pre-gyp install --fallback-to-build --library=static_library
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

Most helpful comment

Issue Resolved!
In my case, I faced the same issue...
I installed
npm install -g [email protected]

and removed cap ^ in package.json before firebase version.

hopeItWillWorkForYou

All 18 comments

What OS and Node.js version are you using?

I received the same error both with NodeJS 8.5.0 and again after downgrading to NodeJS 6.11.3. In both cases I was running on Ubuntu 16.04 LTS

Looks like OP is running Linux 4.10, tries to install the latest grpc, and fails with a permissions issue on his machine.

gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/firebase-tools/node_modules/grpc/build'
gyp ERR! System Linux 4.10.0-35-generic

_Possible root cause:_ Node and npm were installed under root and into a directory controlled by root.

node : 8.7.0
os : Linux/Ubuntu 17.04/17.10

@mbleigh

Same error for me on Windows 7 x64 + Node v8.6.0 or v8.9.1 (tested both)

Error raised while wanted to try firestore with node.js, so updating firebase stuff to get the lib then bang, super bug.

Looks like a problem with firebase-tools 3.15.3.

The file

C:\Program Files\nodejs\aaa\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node

seems to be referenced but never created.

Especially the following part

node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node

That does not exists in the C:\Program Files\nodejs\aaa\node_modules\grpc\src directory.

yarn install v1.3.2
warning package.json: License should be a valid SPDX license expression
warning package.json: "dependencies" has dependency "google-closure-compiler" with range "^20170910.0.0" that collides with a dependency in "devDependencies" of the same name with version "latest"
info No lockfile found.
warning [email protected]: License should be a valid SPDX license expression
warning [email protected]: "dependencies" has dependency "google-closure-compiler" with range "^20170910.0.0" that collides with a dependency in "devDependencies" of the same name with version "latest"
[1/4] Resolving packages...
warning [email protected]: It is recommended to install Yarn using the native installation method for your environment. See https://yarnpkg.com/en/docs/install
warning firebase-tools > universal-analytics > [email protected]: Use uuid module instead
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[4/5] ⡀ grpc: https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.2/node-v57-win32-x64-unknown.tar.gz
[-/5] ⡀ waiting...
[3/5] ⡀ puppeteer
[-/5] ⡀ waiting...
error C:\Program Files\nodejs\aaa\node_modules\grpc: Command failed.
Exit code: 7
Command: .\node_modules\.bin\node-pre-gyp install --fallback-to-build --library=static_library
Arguments:
Directory: C:\Program Files\nodejs\aaa\node_modules\grpc
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | win32 | x64
node-pre-gyp info check checked for "C:\Program Files\nodejs\aaa\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node" (not found)
node-pre-gyp http GET https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.2/node-v57-win32-x64-unknown.tar.gz
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack TypeError: require(...).Extract is not a function
node-pre-gyp ERR! stack     at C:\Program Files\nodejs\aaa\node_modules\node-pre-gyp\lib\install.js:79:40
node-pre-gyp ERR! stack     at download (C:\Program Files\nodejs\aaa\node_modules\node-pre-gyp\lib\install.js:69:12)
node-pre-gyp ERR! stack     at place_binary (C:\Program Files\nodejs\aaa\node_modules\node-pre-gyp\lib\install.js:73:5)
node-pre-gyp ERR! stack     at C:\Program Files\nodejs\aaa\node_modules\node-pre-gyp\lib\install.js:183:17
node-pre-gyp ERR! stack     at FSReqWrap.cb [as oncomplete] (fs.js:313:19)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\aaa\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Program Files\nodejs\aaa\node_modules\grpc
node-pre-gyp ERR! node -v v8.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39

That's a hot topic :

https://github.com/firebase/firebase-js-sdk/issues/221
https://github.com/firebase/firebase-js-sdk/issues/267
https://github.com/firebase/firebase-functions/issues/130
https://github.com/firebase/firebase-admin-node/issues/132
https://github.com/firebase/firebase-tools/issues/442
https://github.com/firebase/firebase-tools/issues/522

Follow-up :

OK :)
firebase 4.6.2
firebase-admin 5.3.0
firebase-tools 3.7.0

KO :(
firebase 4.7.0 +
firebase-admin 5.4.0 +
firebase-tools 3.8.0 +

At this stade you might think older versions could work with firestore.
But, if you want to use firestore, it will claim the grpc node module, and if you yarn it, same error :/


Found a related bug with node-pre-gyp :
https://github.com/mapbox/node-pre-gyp/issues/318

It appears that a capital letter is used instead of a regular letter, causing the function to not be found.

problem fixed on my system

Ok, after several tries, let's just say _yarn_ fails, but _npm install_ works.

I am also getting the same error when try to install npm install firebase.

Please check this screen shot.

image

Do you also get issue if you just did: "npm install grpc"?

If you do, please file an issue at https://github.com/grpc/grpc-node/issues

@laurenzlong Thanks a lot and i got the solutin in the above URL

I faced a similar problem. For me, the problem seemed to be my antivirus (Kaspersky). Once I disabled it, I was able to install firebase.

Thanks for sharing! I'm going to leave this issue open so other people can read out the different workarounds.

I'd like to consolidate grpc installation issues at grpc/grpc-node#121

Issue Resolved!
In my case, I faced the same issue...
I installed
npm install -g [email protected]

and removed cap ^ in package.json before firebase version.

hopeItWillWorkForYou

Issue resolved by removing cap ^ in package.json before firebase dependency.

Nothing worked for me. What I did, at last, I took grpc folder from some other project node_module folder and placed it into the new one. After that, I did 'npm install' and everything worked smoothly.

I had the same issue. Tried to re-install, install global, etc and fixed only after this:

Issue resolved by removing cap ^ in package.json before firebase dependency.

Thanks @shubhtrino

Nothing worked for me. What I did, at last, I took grpc folder from some other project node_module folder and placed it into the new one. After that, I did 'npm install' and everything worked smoothly.

I had the same issue and invested 3 hrs of mine.This works finally.Thanks Sir! @JavaidAhmad

Was this page helpful?
0 / 5 - 0 ratings