Comments (13)
Didi you do npm install --save @google-cloud/logging
from the functions directory? Basically you need a package.json file inside your functions directory and that should be it. IF that's what you did can you paste here the content of your package.json ?
from functions-samples.
Thanks for answer
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"dependencies": {
"@google-cloud/logging": "^0.8.0",
"firebase-admin": "^4.1.2",
"firebase-functions": "^0.5",
"google-cloud": "^0.48.0",
"stripe": "^4.15.1"
},
"private": true
}
I checked @google-cloud/logging and it is
from functions-samples.
{
"_args": [
[
{
"raw": "@google-cloud/logging",
"scope": "@Google-Cloud",
"escapedName": "@Google-Cloud%2flogging",
"name": "@google-cloud/logging",
"rawSpec": "",
"spec": "latest",
"type": "tag"
},
"/Users/alex/Desktop/Developer/Work/Covet/covet/functions"
]
],
"_from": "@google-cloud/logging@latest",
"_id": "@google-cloud/[email protected]",
"_inCache": true,
"_location": "/@google-cloud/logging",
"_nodeVersion": "7.6.0",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/logging-0.8.0.tgz_1489524423597_0.2694959039799869"
},
this package @google-cloud/logging
from functions-samples.
When did you get the error? When you did "firebase deploy" ? or when you tried to run your function after the deploy?
from functions-samples.
when I deployed I haven't error. When I go to the firebase log I found this error.
from functions-samples.
Very strange indeed, especially because we run your code locally when deploying the Functions.
Can you look at your deployed code? It is located in your staging bucket. Open this page to see your buckets: https://console.cloud.google.com/storage/browser?project=_
then look at the bucket named staging.<project-id>.appspot.com
it contains a firebase-functions-source
file which is a zip file. Download it and de-compress it, then have a look inside it should have these files:
Please check the package.json
lookss OK and lists all the dependencies.
from functions-samples.
thanks for your answers
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"dependencies": {
"firebase-admin": "^4.1.2",
"firebase-functions": "^0.5",
"google-cloud": "^0.48.0"
},
"private": true
}
It is so strange. Or it is ok?
from functions-samples.
Strange because it's not the same one as the one you provided in comment 3. It's missing a two dependencies. can you re-deploy and check again? :)
from functions-samples.
so I tried to re-deploy but nothing changing. After than I delete folder staging..appspot.com, delete folder functions in my project. Using readme I tried to do all steps.
after deploy I get message
=== Deploying to 'covet-aca4f'...
i deploying database, functions, hosting
✔ database: rules ready to deploy.
i functions: ensuring necessary APIs are enabled...
i runtimeconfig: ensuring necessary APIs are enabled...
✔ runtimeconfig: all necessary APIs are enabled
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i hosting: preparing public directory for upload...
✔ hosting: public folder uploaded successfully
✔ hosting: 1 files uploaded successfully
i starting release process (may take several minutes)...
✔ Deploy complete!
I go to project and check log but there no changing. When I opened https://console.cloud.google.com/storage/browser?project=_ the folder staging didn't created.
Do you have any idea why? Which is my next steps?
Thanks a lot
from functions-samples.
In this last log it looks like there is no Functions being deployed. Can you check that firebase version
returns 3.5.0
?
from functions-samples.
Also did you just download a fresh version of the stripe sample? Or did you modify anything?
from functions-samples.
thanks a lot I forget copy index.js file.
from functions-samples.
Does someone would like to help me resolve this problem? I know the issue is closed but I did not find the solution this problem not in closed issue not on stackoverflow.
firebase deploy
`badar:firbase-funcitons$ firebase deploy functions
Error: Too many arguments. Run firebase help deploy for usage instructions
badar:firbase-funcitons$ sudo firebase deploy functions
[sudo] password for badar:
Error: Too many arguments. Run firebase help deploy for usage instructions
Having trouble? Try firebase deploy --help
badar:firbase-funcitons$ sudo firebase deploy --only functions
=== Deploying to 'pcbs-25985'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
Error: Error parsing triggers: Cannot find module 'firebase-admin'
Try running "npm install" in your functions directory before deploying.
Having trouble? Try firebase deploy --help
badar:firbase-funcitons$ cd functions/
badar:functions$ ls
index.js node_modules package.json
badar:functions$ sudo npm install
> [email protected] install /root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/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.6.6/node-v59-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/build'
gyp ERR! System Linux 4.4.0-104-generic
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=/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/src/node/extension_binary/node-v59-linux-x64/grpc_node.node" "--module_name=grpc_node" "--module_path=/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/src/node/extension_binary/node-v59-linux-x64"
gyp ERR! cwd /root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc
gyp ERR! node -v v9.2.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/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/src/node/extension_binary/node-v59-linux-x64/grpc_node.node --module_name=grpc_node --module_path=/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/src/node/extension_binary/node-v59-linux-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:159:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:943:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Linux 4.4.0-104-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc
node-pre-gyp ERR! node -v v9.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
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=/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/src/node/extension_binary/node-v59-linux-x64/grpc_node.node --module_name=grpc_node --module_path=/root/AndroidStudioProjects/PCBS/firbase-funcitons/functions/node_modules/firebase-admin/node_modules/grpc/src/node/extension_binary/node-v59-linux-x64' (1)
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/badar/.npm/_logs/2017-12-28T12_15_39_886Z-debug.log`
For more information about files I have attached the gist link.
https://gist.github.com/badarshahzad/f5260022edfea28527f882e61d20d672
from functions-samples.
Related Issues (20)
- [BUG] in sample:
- [BUG] in sample:
- LGTM
- [DOCS] Example app in readme.md does not work HOT 1
- [DOCS] for sample: taskqueues-backup-images, not clear how to set up "impersonation" permission HOT 2
- [BUG] in sample: alert
- DisplayUnlockCaptcha
- [BUG] in sample:
- [DOCS] for sample: taskqueues-backup-images, it simply doesn't work with tasks_fn.on_task_dispatched function, only with http_fn.on_request function HOT 5
- onTaskDispatched when region is set the function don't deploy to the region in sample:
- [BUG] Some phone numbers do not receive OTP SMS messages with Firebase phone auth: HOT 5
- Problems with sending push notifications
- functions predeploy error: Command terminated with non-zero exit code 2 HOT 1
- functions predeploy error: Command terminated with non-zero exit code 2 HOT 1
- [DOCS] for sample: python callable functions
- How is this still a problem 2 years later? I am running into this now.
- [BUG] in sample: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/v2/providers/scheduler' is not defined HOT 1
- [BUG] in sample:
- [DOCS] for sample: auth-blocking-functions | Cannot extract event_type HOT 1
- [DOCS] for sample: monitor-cloud-logging
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functions-samples.