Skip to content

Instantly share code, notes, and snippets.

@MOgorodnik
Last active July 1, 2022 09:55
Show Gist options
  • Save MOgorodnik/78e98ea92b0734bb1b33 to your computer and use it in GitHub Desktop.
Save MOgorodnik/78e98ea92b0734bb1b33 to your computer and use it in GitHub Desktop.
bash: meteor: command not found
From >>https://forums.meteor.com/t/how-to-config-meteor-command-in-git-bash-on-window-7/9703
Q: I can't use meteor command in git bash on window 7
A: $ meteor --version
bash: meteor: command not found
I try to add environment path ->;C:\Users\Rabbit\AppData\Local\.meteor.
But still don't work.
Go to this directory - C:\Users[your username]\AppData\Local\.meteor
You should see a meteor.bat file there. Create a new file called "meteor" (without any extension and ""). Open it with notepad and paste the following:
#!/bin/sh
cmd //c "$0.bat" "$@"
save the file and now run git bash. You should be able to use meteor command in git bash.
For more information refer to this answer- http://stackoverflow.com/a/2984240312
From >>http://stackoverflow.com/questions/21241688/how-to-use-gitbash-instead-of-windows-cmd-exe-with-meteor-release-0-7-0-1-win2
Q: I am getting started with Meteorjs. I'm a windows user so I downloaded the windows installer package Release 0.7.0.1-win2. I use gitbash for my command line interface and can't get it to recognize meteor. I get the error "sh.exe": meteor: command not found". It works fine in windows command line but I prefer gitbash.
A: I have the perfect answer for you since I literally just solved the issue myself.
First of all make sure meteor works in the default windows command prompt. Next open git bash and check if the following command works:
cmd //c meteor
This runs the command meteor as if you were in the command prompt.
Next step is to set up an alias in git bash so you don't have to type that out each time.
Open git bash and enter the following:
vim ~/.bashrc
this will open/create the bashrc file in VIM, press i to insert and type the following:
alias meteor="cmd //c meteor"
Save and exit vim by first pressing the Esc key then press the ":" key. Now you should be able to enter commands in VIM. Type "wq" and press enter which will write into your .bashrc file and exit vim.
Almost there! Now that you are back in git bash, all you need to do is point to your .bashrc file by entering the following:
source ~/.bashrc
Now you will be able to run meteor commands straight from git bash! Hope that helped!
AA: It shouldn't be too hard - you just need to make sure that the meteor.bat file is in your executable. Check with echo $PATH from the bash console if it is already there.
For me, the meteor 0.7.0.1-win installer appended meteor's folder to the path automatically. However, you can add it manually with:
export PATH=$PATH:/path/to/user/folder/AppData/Local/.meteor
(On CygWin my user folder is at /cygdrive/c/Users/adam - I'm not sure what the equivalent path would be on git bash).
If you like, append that line to your ~/.profile to make sure meteor gets added to the path when the console opens.
Finally, on Windows the executable file is meteor.bat. I made a symbolic link to the filename meteor, just so I wouldn't have to type the .bat:
cd /path/to/user/folder/AppData/Local/.meteor
ln -s meteor.bat meteor.
@ConPosidelov
Copy link

I it did not work in this way under the Win7.
It was possible to solve the problem only when I wrote the full path.

!/bin/sh

C:/Windows/system32/cmd.exe //c "$0.bat" "$@"

@barbier
Copy link

barbier commented Feb 21, 2018

Worked here, man. Thanks a lot! :D
<3

@SugeeshLiyanage
Copy link

create a new file calle meteor, what kind of a file. is that txt file. I am confused, I have been trying to install meteor and even after installing cannot open meteor in gitbash. Help me.

@mohamedmehdigara
Copy link

https://stackoverflow.com/questions/29111648/meteor-command-not-found

Hi. I tried all of the above and even moving my project to C:\Projects> C:\Users\USERNAME\AppData\Local.meteor\meteor my_project

I am still getting the same error message.

Error msg:

bash: meteor: command not found

Note that I used node v.13 because Meteor only works with node > 10 and < 14 using nvm

https://github.com/nvm-sh/nvm/blob/master/README.md#installing-and-updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment