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 installation issues #467

Closed
mayankmetha opened this issue Sep 22, 2017 · 18 comments
Closed

grpc installation issues #467

mayankmetha opened this issue Sep 22, 2017 · 18 comments

Comments

@mayankmetha
Copy link

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/usr/bin/firebase -> /usr/lib/node_modules/firebase-tools/bin/firebase

grpc@1.4.1 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 grpc@1.4.1 and node@8.5.0 (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: grpc@1.4.1 (node_modules/firebase-tools/node_modules/grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grpc@1.4.1 install: node-pre-gyp install --fallback-to-build --library=static_library
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

@mbleigh
Copy link
Contributor

mbleigh commented Sep 22, 2017

What OS and Node.js version are you using?

@peteclodi
Copy link

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

@zzeleznick
Copy link
Contributor

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.

@mayankmetha
Copy link
Author

node : 8.7.0
os : Linux/Ubuntu 17.04/17.10

@dtruffaut
Copy link

dtruffaut commented Nov 26, 2017

@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 aaa@1.0.0: License should be a valid SPDX license expression
warning aaa@1.0.0: "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 yarn@1.3.2: 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 > node-uuid@1.4.8: 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 node-pre-gyp@0.6.39
node-pre-gyp info using node@8.6.0 | 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 :

firebase/firebase-js-sdk#221
firebase/firebase-js-sdk#267
firebase/firebase-functions#130
firebase/firebase-admin-node#132
#442
#522

@dtruffaut
Copy link

dtruffaut commented Dec 1, 2017

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 :
mapbox/node-pre-gyp#318

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

@mayankmetha
Copy link
Author

problem fixed on my system

@dtruffaut
Copy link

Ok, after several tries, let's just say yarn fails, but npm install works.

@nsksaisaravana
Copy link

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

Please check this screen shot.

image

@laurenzlong
Copy link
Contributor

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

@nsksaisaravana
Copy link

@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.

@laurenzlong laurenzlong changed the title error installing via npm grpc installation issues Jan 29, 2018
@laurenzlong
Copy link
Contributor

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

@laurenzlong laurenzlong reopened this Jan 29, 2018
@mbleigh
Copy link
Contributor

mbleigh commented Jan 29, 2018

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

@mbleigh mbleigh closed this as completed Jan 29, 2018
@JavaidAhmad-Venture
Copy link

Issue Resolved!
In my case, I faced the same issue...
I installed
npm install -g firebase@4.6.2

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

@shubhtrino
Copy link

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

@JavaidAhmad
Copy link

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.

@Darwinium
Copy link

Darwinium commented Jan 4, 2019

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

@shubhamgupta608
Copy link

shubhamgupta608 commented Jan 31, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests