16

I was working mostly on Mac, so I have no idea about how to set up git environment on Windows 8.

Today, I was going to start AngularJS on my Windows Machine. On tutorial, I saw it requires git, and I downloaded the "Git for windows", called "MINGW64".

On tutorial, it asked me to use command:

apt-get install nodejs-legacy npm
nodejs --version
npm --version

Then, the bash told me

bash: apt-get: command not found

I was confused and thought the apt-get is a pre-installed thing, so I changed the git setting and re-installed it with all different settings. It still the same.

And I am so surprised that "sudo" is not found as well.

Next, I searched online and had many vague answer which directs to the path, I think that might be the issue, but the person did not clearly say how to solve it. I was hoping can get some help from Stack overflow community how can I install the apt-get and other basic commands packages on git for windows.

If it is a duplicate, please guide me a bit how to use the correct words to mention this issue. I have tried "git for windows has no apt-get", etc on Google, and no luck for me. This has bothered me whole night. Thanks!

Link for AngularJS Tutorial

Link for git for windows

windsound
  • 706
  • 4
  • 9
  • 31
  • You can't. There is no such thing as apt-get for Windows, mainly because there are no software repositories for Windows apt-get could use. If you want to replicate a Linux environment on your Windows machine, install a Linux virtual machine. – n. m. could be an AI Jul 28 '16 at 08:03
  • As for sudo, there are some Windows equivalents, but you normally don't need it for developing software on Windows. Normally you only need sudo to install stuff, e.g. with apt-get, but there's no apt-get (see above). – n. m. could be an AI Jul 28 '16 at 08:11
  • Thank you, I see, so there is no way to create a shell that is similar to Linux shell. Got it. – windsound Jul 28 '16 at 14:36
  • A shell like bash is a program that is used to run other programs. Bash on windows is fairly similar to bash elsewhere, it's the other programs that are not the same. – n. m. could be an AI Jul 28 '16 at 14:41
  • 1
    The bash on Windows work announced at build this year does this. It's actually the entire Ubuntu user mode. Check it out before giving up :). Docs here https://msdn.microsoft.com/commandline/wsl/about – Sarah Cooley Jul 29 '16 at 06:52

2 Answers2

8

Update

With WSL, It's now possible to run a complete Linux system, like Ubuntu, inside Windows. and one can install everything, including Node and Git there in the WSL Linux. Just like Sarah Cooley pointed in the other answer from her.

Pre-WSL Answer

If you want Node.js and npm on Windows, you can download them from nodejs.org, apt-get is for Linux (Debian based). Here's a guide.

And Git for Windows is a Windows based Git distribution, it's a separate project from Node.js, and it provides a limited set of linux-like CLI tools compiled natively for Windows.

If you setup PATH correctly, you can indeed run node commands in the Bash shell of Git for Windows.

ryenus
  • 15,711
  • 5
  • 56
  • 63
3

The entire Ubuntu user mode (including BASH) now runs on Windows. Apt-get node etc all work. Check it out. Docs here.

Sarah Cooley
  • 180
  • 4
  • Thanks for the link! I was having trouble with the git for windows, I guess it is just not apply on the app. – windsound Aug 01 '16 at 02:30