googlearchive / cloud-functions-emulator

A local emulator for deploying, running, and debugging Google Cloud Functions.
https://github.com/GoogleCloudPlatform/cloud-functions-emulator/wiki
Apache License 2.0
827 stars 115 forks source link

Installation error #170

Open spidi123q opened 6 years ago

spidi123q commented 6 years ago

when i try install emulator it gives following error

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-fvN/DQEPsCitGtWXIuUG2SYoFcs= integrity checksum failed when using sha1: wanted sha1-fvN/DQEPsCitGtWXIuUG2SYoFcs= but got sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==. (3410 bytes)
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
/usr/local/bin/functions -> /usr/local/lib/node_modules/@google-cloud/functions-emulator/bin/functions
/usr/local/bin/functions-emulator -> /usr/local/lib/node_modules/@google-cloud/functions-emulator/bin/functions

> grpc@1.7.1 install /usr/local/lib/node_modules/@google-cloud/functions-emulator/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.7.1/node-v57-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.7.1 and node@8.6.0 (node-v57 ABI, glibc) (falling back to source compile with node-gyp) 
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/build'
gyp ERR! System Linux 4.4.0-101-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/grpc_node.node" "--module_name=grpc_node" "--module_path=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64"
gyp ERR! cwd /usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc
gyp ERR! node -v v8.6.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/local/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@google-cloud/functions-emulator/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.4.0-101-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc
node-pre-gyp ERR! node -v v8.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.7.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the grpc@1.7.1 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:

also when i try to run firebase serve --only functions it gives following error and runs only hosting functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'

ChaossAdept7 commented 6 years ago

Have similar issue with install of cloud functions. Version of node: v8.9.4

mixcas commented 6 years ago

Same here. I can't install @google-cloud/functions-emulator and can't run firebase serve --only functions.

This is my output:

sudo npm install -g @google-cloud/functions-emulator                                 1 ↵
Password:
/usr/local/bin/functions -> /usr/local/lib/node_modules/@google-cloud/functions-emulator/bin/functions
/usr/local/bin/functions-emulator -> /usr/local/lib/node_modules/@google-cloud/functions-emulator/bin/functions

> grpc@1.7.2 install /usr/local/lib/node_modules/@google-cloud/functions-emulator/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.7.2/node-v57-darwin-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.7.2 and node@8.9.4 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/build'
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown"
gyp ERR! cwd /usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc
gyp ERR! node -v v8.9.4
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/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 17.3.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc
node-pre-gyp ERR! node -v v8.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.7.2 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
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!     /Users/cas/.npm/_logs/2018-01-22T21_52_46_383Z-debug.log

Using node: 8.9.4 npm: 5.6.0

Also if i try to install using sudo yarn global add @google-cloud/functions-emulator it doesn't return any errors but running function prints a lot of source code from zsh.

AAverin commented 6 years ago

https://github.com/grpc/grpc/issues/13673

thollander commented 6 years ago

Maybe this should help :

cd /usr/local/lib/ sudo npm install @google-cloud/functions-emulator sudo npm install -g @google-cloud/functions-emulator

dsouzaedison commented 6 years ago

I am not sure what exactly is causing this problem. But here is the working solution. StackOverflow - Firebase: Cannot start emulator

stephenmathieson commented 5 years ago

Any updates here?

It's very discouraging that this issue has been open for over a year without a maintainer acknowledging it.

ghost commented 5 years ago

The yarn solution worked for me: https://stackoverflow.com/a/52877585/3180309