Git Bash runs NPM on Windows Prompt

Asked

Viewed 213 times

0

I’m using the Git Bash to run my project developed with React.

After I started using the Windows 10, when typing the command npm run dev a new Windows Prompt window opens for running the command, before, the same command was executed within Git Bash itself.

I already looked for how to configure so that the command continues in Gitbash and I’m not finding a solution!

Does anyone know any solution?

  • 1

    Do you use VS Code? Have you tried running the command from the VS terminal?

  • Yes, I’ve tried and the same thing happens, it opens a prompt window. I’m looking for a way to solve in VS Code, until I think it would be more interesting to run by there anyway.

1 answer

1

Use the Ubuntu, or any other Linux distro, available in the Microsoft Store, rather than the Bash that comes with installing Git for Windows.

With that you’ll have the real Bash running on Windows Subsystem for Linux. The advantage is that you will have the same behaviors and customizations of Bash, integrated with Windows, it is currently possible to open the Code, for example, from Bash with the following command:

code .

Then you will probably have the behavior you were used to, or it will be easier to set up to get back to.

WSL2 is already being developed, read more.

  • This note happens here where I work, unfortunately it has to be Windows. It has been a challenge to solve this problem because it worked normal.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.