Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Git for Windows Bash, how to install "get-apt" and "sudo" and all those basic commands? [closed]

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

like image 626
windsound Avatar asked Jul 28 '16 06:07

windsound


People also ask

How install sudo apt-get Windows?

Download and installDownload the installer below and double-click install-windows-apt.exe to start the installer. Install APT to a folder you have default privileges for: We recommend installing this software into the default location (which is a folder within the user's home folder).

Can we use apt-get in Windows?

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.


2 Answers

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

like image 83
Sarah Cooley Avatar answered Oct 22 '22 23:10

Sarah Cooley


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.

like image 35
ryenus Avatar answered Oct 22 '22 23:10

ryenus