Quick-Fixing the Windows command line for JavaScript development
Lea Rosema (she/her)

Lea Rosema (she/her) @learosema

About: Enterprisey Developer by day, creative coder by night. she/her

Location:
Hamburg, Germany
Joined:
Jul 6, 2017

Quick-Fixing the Windows command line for JavaScript development

Publish Date: Sep 10 '18
9 3

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

Comments 3 total

  • Lea Rosema (she/her)
    Lea Rosema (she/her)Sep 10, 2018

    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...).

  • Heiker
    HeikerSep 11, 2018

    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.

Add comment