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

/bin/bash: node-pre-gyp: command not found error when installing #580

Closed
pmaxhogan opened this issue Dec 26, 2017 · 7 comments
Closed

/bin/bash: node-pre-gyp: command not found error when installing #580

pmaxhogan opened this issue Dec 26, 2017 · 7 comments

Comments

@pmaxhogan
Copy link

Version info

Windows 10
Node version: 8.9.1
NPM version: 5.6.0
Firebase Tools Version: 3.16.0

Steps to reproduce

>npm install -g firebase-tools
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\programmer5000\AppData\Roaming\npm\firebase -> C:\Users\programmer5000\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase

> grpc@1.7.2 install C:\Users\programmer5000\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library

/bin/bash: node-pre-gyp: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grpc@1.7.2 (node_modules\firebase-tools\node_modules\grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grpc@1.7.2 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn ENOENT

+ firebase-tools@3.16.0
added 22 packages, removed 2 packages and updated 17 packages in 259.378s

>firebase serve --only functions,hosting

=== Serving from 'C:\Users\programmer5000\Desktop\firebase-test'...

!  functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'
i  hosting: Serving hosting files from: public
+  hosting: Local server: http://localhost:5000

Expected behavior

The functions emulator should start successfully.

Actual behavior

! functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config' and /bin/bash: node-pre-gyp: command not found

Installing @google-cloud/functions-emulator manually

>npm i -g @google-cloud/functions-emulator
C:\Users\programmer5000\AppData\Roaming\npm\functions-emulator -> C:\Users\programmer5000\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\bin\functions
C:\Users\programmer5000\AppData\Roaming\npm\functions -> C:\Users\programmer5000\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\bin\functions

> grpc@1.7.2 install C:\Users\programmer5000\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library

/bin/bash: node-pre-gyp: command not found
npm ERR! file bash
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! grpc@1.7.2 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the grpc@1.7.2 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!     C:\Users\programmer5000\AppData\Roaming\npm-cache\_logs\2017-12-26T07_55_27_259Z-debug.log

I keep getting this strange /bin/bash: node-pre-gyp: command not found error. How can I solve this?

@inlined
Copy link
Member

inlined commented Dec 26, 2017

GRPC is a native (aka written in C) extension and it looks like Windows needs extra tools for this. Try running npm install -g node-pre-gyp

@pmaxhogan
Copy link
Author

Hmm, I still get the same error after running that:

>npm install -g node-pre-gyp
C:\Users\programmer5000\AppData\Roaming\npm\node-pre-gyp -> C:\Users\programmer5000\AppData\Roaming\npm\node_modules\node-pre-gyp\bin\node-pre-gyp
+ node-pre-gyp@0.6.39
updated 1 package in 77.542s
>npm install -g firebase-tools
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\programer5000\AppData\Roaming\npm\firebase -> C:\Users\programer5000\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase

> grpc@1.7.2 install C:\Users\programer5000\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library

/bin/bash: node-pre-gyp: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grpc@1.7.2 (node_modules\firebase-tools\node_modules\grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grpc@1.7.2 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn ENOENT

+ firebase-tools@3.16.0
added 4 packages and updated 1 package in 173.262s

and when I try to serve, I get the same error

>firebase serve --only functions,hosting

=== Serving from 'C:\Users\philip.hogan\programmer5000\vote-cats-server'...

!  functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'

@inlined
Copy link
Member

inlined commented Dec 26, 2017

Hmm.. I see that you're running Bash on Windows. This could make the search path really weird. A lot of times tools for Unix correctly set up the search path for all future shells. As a stupid check, can you open a new window and try again? which node-pre-gyp should return a valid path.

@pmaxhogan
Copy link
Author

Actually, I have bash on windows installed, but i am not using it.

@inlined
Copy link
Member

inlined commented Dec 26, 2017

It looks like Node may be trying to use it. See above where the command was:

/bin/bash: node-pre-gyp: command not found

For sanity's sake, I'd either remove BoW or also install node-pre-gyp there.

@inlined
Copy link
Member

inlined commented Dec 26, 2017

And fwiw, take my advice with a grain of salt. We're getting outside my Windows expertise. I prefer the option to install node-pre-gyp in Bash on Windows because it's less invasive if I'm giving bad advice.

@mbleigh
Copy link
Contributor

mbleigh commented Jan 29, 2018

Please follow up on GRPC installation issues in grpc/grpc-node#121 as I'm trying to consolidate feedback there.

@mbleigh mbleigh closed this as completed Jan 29, 2018
yuchenshi pushed a commit that referenced this issue Sep 18, 2024
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

3 participants