I'm trying to install flutterfire_cli in my root project, so I typed this command:
FirebaseFirestore firestore = FirebaseFirestore.instance;
so after that, this is the output of my console:
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.
To fix the warning I added C:\Users\PC\AppData\Local\Pub\Cache\bin to my Path in system variables environnement. (but it does not work, I'm still getting the warning)
Next, I'm trying to generate the firebase_options.dart file as the documentation says using this command:
flutterfire configure
But I'm getting an error in the console:
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
Could anyone tell me what I am missing, why I am getting this error even if the Firebase CLI already installed on my machine?
Go through this doc very carefully: https://firebase.flutter.dev/docs/cli/
Step 1: Install Firebase CLI
Step 2: Install FlutterFire CLI with this command dart pub global activate flutterfire_cli
While doing this you must notice the following warning
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.
This means you need to add C:\Users\*username*\AppData\Local\Pub\Cache\bin into your System's environment path.
Step 3: Now flutterfire configure should work.
If still not working play with Firebase commands
For Mac -> Execute this command:
export PATH="$PATH":"$HOME/.pub-cache/bin"
Three 3 steps for getting it work on Windows:
Run this command:
dart pub global activate flutterfire_cli
Type env into Windows search and open Edit the system environment variables --> Environment variables --> System variables( the one on the bottom of the window) --> Double click on Path --> New and enter this:
C:\Users\PutHereYourUsername\AppData\Local\Pub\Cache\bin
flutterfire configure command should work now - close and open again command prompt or other terminal. Sometimes there is a problem with other editors and terminals where flutterfire configure still does not work. In that case open Command Prompt and it works there for sure.
As for me, I have done everything correctly and the command works if I run in the Windows command prompt, but it fails to work if I type the command inside the VS code terminal.
So I just killed the terminal and opened it again, then it works.
Or, you can try restarting your machine.
Even after adding C:\Users\PC\AppData\Local\Pub\Cache\bin to the path for me flutterfire would not work from the command line, the reason being that it actually instally a flutterfire.bat file.
So I use flutterfire.bat in the command line as of now and that is working.
For Linux/Ubuntu run this command in the terminal,
export PATH="$PATH":"$HOME/.pub-cache/bin"
Which you will also notice in the terminal when you run the command ↓.
dart pub global activate flutterfire_cli
Make sure you are your project directory
run this export PATH="$PATH":"$HOME/.pub-cache/bin"
For Linux/Ubuntu you should do the following:
Open your .bashrc file using the command "sudo nano ~/.bashrc"
Add export PATH="$PATH":"$HOME/.pub-cache/bin" to the end of the file.
Final you can source the file using "source ~/.bashrc"
It should now be able to recognize the file.
for macOS Monterey edit ~/.zprofile instead .zshrc
This was the hack i used to solve mine. I copied and pasted the C:\Users\PC\AppData\Local\Pub\Cache\bin in my folder search bar to enter the folder, note I could not find any folder called AppData, but when I pasted it on the folder search it did take me to the bin folder.
In the bin folder, you will find a file called flutterfire.bat. Copy and paste the flutterfire.bat file in the root of your project and then run the .\flutterfire configure command. Please do note the dot (.) and forward-slash (\). You need to add it to work.
for mac m1 , add
export PATH="$PATH":"$HOME/.pub-cache/bin" at the top of users/username/.profile , works on (monterey)
For me, even after I installed everything correctly, restarting my IDE(VSCode) did the trick.
Flutter command not found
Here is very easy instructions for adding something to your path on Mac, It solved my issues with Flutter and Flutterfire.
The export PATH="$PATH":"$HOME/.pub-cache/bin" did not work on my Debian machine!
I removed the first line #!/usr/bin/env sh from $HOME/.pub-cache/bin/flutterfire file and the flutterfire command worked properly.
Use command prompt.. not the vsc terminal
if you followed the right answer and still not working, you need to restart your computer
When I try to execute the command:
grunt build
I get the following warning:
Warning: Couldn't find the `compass.bat` binary. Make sure it's installed and in your $PATH Use --force to continue.
Aborted due to warnings.
I've checked and I have ruby and compass properly installed on my computer and the ruby/bin is correctly indicated on the PATH variable. Both compass and ruby/gem are recognized by my console.
Can someone give me an hand?
I'm new to all of this and I've been following tutorials the best I can, I wanted to try my hand at web app development but I'm clearly doing something or missing something.
I ran pip install Django in my Atom terminal, it said the installation was successful but threw a warning about my install file not being part of the PATH, even though that file is in fact on PATH but I believe I fixed that issue.
I then tried to follow a Django tutorial which told me to pip install venv, I couldn't get that to function but I did find the virtual environment package on Atom atom-python-virtualenv and installed it.
its there in my drop down package menu but when I click make and enter a name nothing happens.
I have been trying repeatedly to figure out how to activate a virtual environment in my atom terminal since last night and nothing seems to work! I tried the same commands in my windows powershell and they worked perfectly fine, so I went back to Atom and within that powershell tried again and the first couple things worked but I still ended up with an error which I'll copy/paste below;
PS C:\Users\Amelia\Documents\Atom Projects\microblog> cd env:
PS Env:\> ls virtual_env
ls : Cannot find path 'virtual_env' because it does not exist.
At line:1 char:1
+ ls virtual_env
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (virtual_env:String) [Get-ChildItem], ItemN
otFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemComm
and
PS Env:\> cd c:
PS C:\Users\Amelia\Documents\Atom Projects\microblog> .\venv\Scripts\activate
.\venv\Scripts\activate : The term '.\venv\Scripts\activate' 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
+ .\venv\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.\venv\Scripts\activate:String) [], Comman
dNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I have no idea what i'm doing wrong here, the venv files are there in my script file if I look but nothing I do seems to allow them to be activated.
All I want to do is learn how to do this stuff and I can't get it to work. This is the first issue I've run into so far and I'm at a total loss as to how I might fix this.
is venv just completely incompatible with Atom??
I'm running Windows 10 if that helps in anyway.
My friend, first of all you have to select a specific folder for your project in a certain way in your system.
Then create a virtualenv via cmd on that path..
Now I'm activating my virtualenv via cmd
Now I'm inside my Virtualenv, I can log in if Atom is installed on my system
Now in the Atom software, at the bottom left of the screen, press noVirtualenv.
A window opens where your Virtualenv name is displayed, and you can select it by tapping on it.
Now your Virtualenv is ready and you can create or import your own project and get started.
You can activate virtual environments from the command line by typing
mypthon\Scripts\activate
where mypython is the name you gave to your virtual environment. This assumes the Atom extension correctly created the virtual environment.
I'm trying to run gulp-ruby-sass on Windows.
I've already installed Ruby and Sass like that:
$ gem install sass
My gulp.task looks like this:
gulp.task('styles', function() {
return sass('src/scss/**/*.scss')
.on('error', sass.logError)
.pipe(gulp.dest('css'));
});
When I cd into the root directory of my project and run $ gulp styles,
I get this:
[22:54:52] Using gulpfile c:\wamp\www\wordpress\
wp-content\themes\bootscores\gulpfile.js
[22:54:52] Starting 'styles'...
[22:54:52] 'sass' is not recognized as an internal or external command,
operable program or batch file.
Error in plugin 'gulp-ruby-sass'
Message:
Gem undefined is not installed.
[22:54:52] Finished 'styles' after 89 ms
I've been searching for a solution to this problem for about two hours now and still haven't found one that would help me.
I've finally found a solution.
I had to manually add a path to my Ruby bin folder in Control Panel > System > Advanced > Environment Variables. Here i added a new variable named path with a path to my Ruby bin folder (C:\Ruby22-x64\bin).
Then I restarted my Node.js command prompt and got the output I was looking for.
Thank you, CDF, for you answer and effort!
Even though I answered this question myself, I hope it will eventually help other people too.
I had the same error, only in my situation sass package wasn't installed in RubyGem.
You need to execute following command:
gem install sass
Use the Ruby installer and reinstall it. Then check the path checkbox. It should be resolved then.
Install Sass Using the Command Prompt
[CMD] + [R]
type cmd hit [ENTER]
Type gem install sass
If you get an error message then it's likely you will need to use the sudo command to install the Sass gem. It would look like:
sudo gem install sass
4 Reboot the NODE command line. In fact you might want to reboot the system, most users do not do enough of that.
When I use this plugin, Grunt for Brackets, it doesn't seem to work for me. I've looked and looked and looked through the files of the extension, and when I "grunt," my devtools spit out this log.
[node-log 10:01:49 AM] { '0': { [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' } }
I'm not exactly sure what that means...
Here is a link to the extension.
The author has not updated anything in months, and there is an open issue ticket, however there hasn't been any responses.
If someone could help me decipher this log, I would greatly appreciate it.
Do you have Grunt installed on your computer already? If so, is it installed in the standard location? (e.g. did you intsall using npm -g grunt?)
ENOENT basically means "file not found," and since the error message also says spawn I'm guessing the problem is it's unable to find the Grunt binary to execute.
Update: Looks like a bug in how the current version of the extension was packaged. You should be able to fix it yourself this way:
Help > Show Extensions Folder in Brackets and find the brackets-grunt extension in the 'user' subfolder
Open a command prompt at that location
cd into the node folder inside the extension
Run npm install
I added a note to the bug, so hopefully the extension's author will fix it soon too.