首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >术语“flutterfire”不被识别为cmdlet、函数、脚本文件或可操作程序的名称。

术语“flutterfire”不被识别为cmdlet、函数、脚本文件或可操作程序的名称。
EN

Stack Overflow用户
提问于 2021-12-12 01:24:12
回答 15查看 59.7K关注 0票数 49

我试图在我的根项目中安装flutterfire_cli,所以我输入了以下命令:

代码语言:javascript
运行
复制
FirebaseFirestore firestore = FirebaseFirestore.instance;

在此之后,这就是我的控制台的输出:

代码语言:javascript
运行
复制
PS C:\Users\PC\Desktop\eventually> dart pub global activate flutterfire_cli
Package flutterfire_cli is currently active at version 0.1.1+2.
Resolving dependencies...
The package flutterfire_cli is already activated at newest available version.
To recompile executables, first run `global deactivate flutterfire_cli`.
Installed executable flutterfire.
Warning: Pub installs executables into C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated flutterfire_cli 0.1.1+2.

为了修复警告,我在系统变量环境中将C:\Users\PC\AppData\Local\Pub\Cache\bin添加到我的路径中。(但这不起作用,我还在收到警告)

接下来,我尝试使用以下命令生成firebase_options.dart文件,如文档所述:

代码语言:javascript
运行
复制
flutterfire configure

但是我在控制台上发现了一个错误:

代码语言:javascript
运行
复制
PS C:\Users\PC\Desktop\eventually> flutterfire configure
flutterfire : The term 'flutterfire' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ flutterfire configure
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (flutterfire:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

有人能告诉我我遗漏了什么吗,为什么我会得到这个错误,即使Firebase CLI已经安装在我的机器上了?

EN

回答 15

Stack Overflow用户

回答已采纳

发布于 2021-12-12 16:09:31

仔细阅读这个文档:https://firebase.flutter.dev/docs/cli/

步骤1:安装火基CLI

步骤2:使用以下命令安装FlutterFire CLI

在执行此操作时,您必须注意以下警告

Warning: Pub installs executables into C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path. You can fix that by adding that directory to your system's "Path" environment variable. A web search for "configure windows path" will show you how.

这意味着您需要将C:\Users\*username*\AppData\Local\Pub\Cache\bin添加到系统的环境路径中。

第三步:现在flutterfire configure应该能工作。

如果仍然不能使用[消]消防命令

票数 105
EN

Stack Overflow用户

发布于 2022-06-06 16:16:06

对于Mac ->,请执行以下命令:

export PATH="$PATH":"$HOME/.pub-cache/bin"

票数 44
EN

Stack Overflow用户

发布于 2022-01-03 01:23:21

至于我,我已经正确地完成了所有事情,如果我在Windows命令提示符中运行,这个命令就能工作,但是如果我在VS代码终端中输入命令,它就不能工作。

所以我杀了终端机,然后再打开它,然后它就开始工作了。

或者,你可以试着重新启动你的机器。

票数 14
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70320263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档