【发布时间】:2020-12-04 07:46:14
【问题描述】:
我是使用 Firebase 函数的新手,我正在尝试为 Firebase 设置函数,以便为我的应用中的常见活动设置通知,但我正在遵循 firebase 建议的步骤(见下文) Function 文件夹在错误的路径中生成(见下文),firebase 函数屏幕仍然要求设置。
Function 文件夹应该是在我的项目文件夹中创建的,我该如何解决这个问题?
1:$ npm install -g firebase-tools
2:$ firebase init
3:$ firebase deploy
C:\Users\BAQ-229\AndroidStudioProjects\reviu\Functions>firebase init
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
C:\Users\BAQ-229
Before we get started, keep in mind:
* You are initializing in an existing Firebase project directory
? Are you ready to proceed? Yes
? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confirm your choices. Functions: Configure and deploy Cloud Functions
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
i .firebaserc already has a default project, using jobly-b45bf.
=== Functions Setup
A functions directory will be created in your project with a Node.js
package pre-configured. Functions can be deployed with firebase deploy.
? What language would you like to use to write Cloud Functions? JavaScript
? Do you want to use ESLint to catch probable bugs and enforce style? Yes
+ Wrote functions/package.json
+ Wrote functions/.eslintrc.json
+ Wrote functions/index.js
+ Wrote functions/.gitignore
? Do you want to install dependencies with npm now? Yes
> protobufjs@6.10.1 postinstall C:\Users\BAQ-229\functions\node_modules\protobufjs
> node scripts/postinstall
npm notice created a lockfile as package-lock.json. You should commit this file.
added 361 packages from 266 contributors and audited 361 packages in 12.507s
32 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
i Writing configuration info to firebase.json...
i Writing project information to .firebaserc...
+ Firebase initialization complete!
C:\Users\BAQ-229\AndroidStudioProjects\reviu\Functions>firebase deploy
=== Deploying to 'jobly-b45bf'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint C:\Users\BAQ-229\functions
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
+ functions: required API cloudbuild.googleapis.com is enabled
+ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing functions directory for uploading...
+ Deploy complete!
Project Console: https://console.firebase.google.com/project/jobly-b45bf/overview
【问题讨论】:
-
路径错误是什么意思?您希望它在哪里以及它是在哪里创建的?
-
我希望它在我的项目文件中使用以下路径创建:C:\Users\BAQ-229\AndroidStudioProjects\reviu
标签: node.js firebase flutter google-cloud-functions firebase-tools