Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use gitbash instead of windows cmd.exe with meteor Release 0.7.0.1-win2

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.

How do I get meteor to work with gitbash?

like image 823
Dustin Fraker Avatar asked Jan 20 '14 18:01

Dustin Fraker


1 Answers

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!

like image 142
Huan Zhang Avatar answered Sep 18 '22 04:09

Huan Zhang