programing

'flutterfire'라는 용어가 cmdlet, 함수, 스크립트 파일 또는 작동 가능한 프로그램의 이름으로 인식되지 않습니다.

goodjava 2023. 6. 4. 18:40

'flutterfire'라는 용어가 cmdlet, 함수, 스크립트 파일 또는 작동 가능한 프로그램의 이름으로 인식되지 않습니다.

루트 프로젝트에 flotfire_cli를 설치하려고 하기 때문에 다음 명령을 입력했습니다.

FirebaseFirestore firestore = FirebaseFirestore.instance;

다음은 제 콘솔의 출력입니다.

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\시스템 변수 환경의 myPath에 Pub\Cache\bin.(그러나 작동하지 않습니다. 경고가 계속 표시됩니다.)

다음으로 설명서에 나와 있는 대로 다음 명령을 사용하여 firebase_options.dart 파일을 생성하려고 합니다.

flutterfire configure

하지만 콘솔에 오류가 표시됩니다.

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가 이미 컴퓨터에 설치되어 있는데도 내가 무엇을 놓쳤는지, 왜 이런 오류가 발생하는지 누가 알려줄 수 있습니까?

문서를 주의 깊게 살펴보십시오. https://firebase.flutter.dev/docs/cli/

1단계: Firebase CLI 설치

2단계: 이 명령을 사용하여 FlotterFire CLI 설치dart pub global activate 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시스템의 환경 경로로 이동합니다.

MacOS의 경우 실행:export PATH="$PATH":"$HOME/.pub-cache/bin"

3단계: 지금flutterfire configure작동해야 합니다.

그래도 작동하지 않는 경우 Firebase 명령으로 재생

Mac의 경우 -> 다음 명령을 실행합니다.

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

Windows에서 작동하기 위한 3단계:

  1. 다음 명령을 실행합니다.

    다트 펍 글로벌 활성화 flatfire_cli

  2. Windows 검색에 env를 입력하고 Edit the system envariables --> Environment variables --> System variables (창 하단에 있는 변수) --> Path --> New를 두 번 클릭한 후 다음을 입력합니다.

    C:\사용자\여기에 입력사용자 이름\AppData\Local\Pub\Cache\bin

  3. flutterfire configure명령이 지금 작동해야 합니다. 명령 프롬프트 또는 다른 터미널을 닫았다가 다시 엽니다.때때로 다른 편집기와 터미널에 문제가 있습니다.flutterfire configure여전히 작동하지 않습니다.이 경우 명령 프롬프트를 열면 확실히 작동합니다.

저는 모든 것을 올바르게 수행했으며 Windows 명령 프롬프트에서 실행하면 명령이 작동하지만 VS 코드 터미널 내부에 명령을 입력하면 명령이 작동하지 않습니다.

그래서 그냥 터미널을 죽이고 다시 열었더니 작동합니다.

또는 컴퓨터를 다시 시작해 볼 수 있습니다.

C를 추가한 후에도:\Users\PC\AppData\Local\flatterfire 경로에 대한 Pub\Cache\bin은 명령줄에서 작동하지 않습니다. 그 이유는 실제로 flatterfire.bat 파일을 설치하기 때문입니다.

그래서 현재 명령줄에서 flootfire.bat을 사용하고 있으며 작동하고 있습니다.

Linux/Ubuntu의 경우 터미널에서 이 명령을 실행합니다.

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

↓ 명령을 실행할 때 터미널에도 표시됩니다.

다트 펍 글로벌 활성화 flatfire_cli

  1. 사용자가 프로젝트 디렉토리인지 확인합니다.
  2. 이것을 실행합니다.export PATH="$PATH":"$HOME/.pub-cache/bin"

여기에 이미지 설명 입력

Linux/Ubuntu의 경우 다음을 수행해야 합니다.

  1. "sudo nano ~/.bashrc" 명령을 사용하여 .bashrc 파일을 엽니다.
  2. 파일 끝에 내보내기 PATH="$PATH":"$HOME/.pub-cache/bin"을 추가합니다.
  3. 마지막으로 "source ~/.bashrc"를 사용하여 파일을 소스할 수 있습니다.
  4. 이제 파일을 인식할 수 있습니다.

Windows: https://stackoverflow.com/a/70325312/11731185

Mac:

  1. 터미널을 열고 실행:

    dart pub global activate flutterfire_cli
    export PATH="$PATH":"$HOME/.pub-cache/bin"
    
  2. 실행:flutterfire --version

  3. 버전 번호가 나오면,flutterfire되었습니다.

macOS Monterey의 경우 .zshrc 대신 ~/.zprofile 편집

이것은 내가 내 것을 해결하기 위해 사용한 해킹이었습니다.는 복해서붙니다습었여넣사▁를 복사해서 .C:\Users\PC\AppData\Local\Pub\Cache\bin에서 AppData라는 수 , 때 "AppData했습니다.bin폴더를 누릅니다.

에는 bin 폴에다같음파은찾수있라는 이 있습니다.flutterfire.bat flootfire.bat 파일을 합니다..\flutterfire configure지휘권참고하시기 바랍니다.dot (.)그리고.forward-slash (\)작업에 추가해야 합니다.

m1의 mac m1을 추가합니다.export PATH="$PATH":"$HOME/.pub-cache/bin"의 맨 에서 (users/profile/.profile의 작업을

모든 것을 올바르게 설치한 후에도 IDE(V 코드)를 다시 시작하는 것이 도움이 되었습니다.

Flutter 명령을 찾을 수 없습니다. 여기 Mac에서 경로에 무언가를 추가하는 매우 쉬운 지침이 있습니다. Flutter 및 Flutterfire와 관련된 문제를 해결했습니다.

내보내기 PATH="$PATH":"$HOME/.pub-cache/bin"이 내 Debian 컴퓨터에서 작동하지 않았습니다!

번째 첫째번줄을제거습다니했▁the다▁first▁removed▁line▁i니습제했거를 제거했습니다.#!/usr/bin/env sh$HOME/.pub-cache/bin/flutterfire 파일의 floatfire 파일입니다.

명령 프롬프트를 사용합니다.VSC 터미널이 아님

만약 당신이 옳은 답을 따랐지만 여전히 작동하지 않는다면, 당신은 당신의 컴퓨터를 다시 시작해야 합니다.

언급URL : https://stackoverflow.com/questions/70320263/the-term-flutterfire-is-not-recognized-as-the-name-of-a-cmdlet-function-scri