DEV Community

Lea Rosema (she/her)
Lea Rosema (she/her)

Posted on • Edited on

Quick-Fixing the Windows command line for JavaScript development

A major issue with using Windows for web development is the lack of a nice unix-like shell environment. Although most of the JavaScript NPM tooling also works with PowerShell or CMD, I have experienced some weird Command not found issues when working with some packages on a drive other than C:\.

An easy fix for that is to just use the bash shell that comes with git. It's more lightweight than installing a complete Linux/msys2/cygwin distribution and it suffices for most JavaScript development purposes.

I like to use the git bash in combination with hyper.is for a nice terminal experience. Just configure the shell setting to
'C:\\Program Files\\Git\\bin\\bash.exe'. I'm using a darker version of rebeccapurple as the background color (#221133) 💁.

Hyper terminal featuring git bash on Windows

If you are using vscode, you can adjust your integrated shell via settings.json accordingly:

{
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    ...
}
Enter fullscreen mode Exit fullscreen mode

Top comments (3)

Collapse
 
learosema profile image
Lea Rosema (she/her)

Using the git bash works for me. So, my actual problem with incompatibilities alongside with the CMD or PowerShell command line is actually solved :).

Also, everything in %PATH% like the node.exe and stuff are available in the git bash.

Installing the native bash on Windows 10 is also a solution. But it involves installing Windows Subsystem for Linux and a Linux distribution (see: docs.microsoft.com/en-us/windows/w...).

Collapse
 
vonheikemen profile image
Heiker

Thanks for sharing this.

I would like to add that Cmder with git for windows is another good alternative for this kind of issues. I used it for a year and was quite happy with it.