Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sudo/apt-get command not found in git bash

Tags:

linux

git-bash

I am using Windows 10 in my machine, and currently installed git bash on it.

I wanted to install node and npm for my application.

when i tried :

apt-get install nodejs

"apt-get" command not found,

I tried google and got

sudo install nodejs

"sudo" command not found.

How to use sudo and apt-get command on my git bash.

like image 615
Swapnil Chaudhari Avatar asked Dec 22 '16 14:12

Swapnil Chaudhari


2 Answers

Git for Windows comes with a Windows port of Bash and a collection of few more common *nix command-line tools that have been compiled for Windows, it does not provide a complete *nix environment. Hence you cannot use tools like sudo and apt-get which modify the *nix operating system.

However, there are other tools, programs if you like, available.

Try to install node " the windows way ".

like image 144
vanjiii Avatar answered Oct 21 '22 18:10

vanjiii


Installing applications in git bash does not sound right to me. I would suggest you either use the native Windows installer (https://nodejs.org/) or, if you prefer a package manager, use Chocolatey (https://chocolatey.org/) to install nodejs with:

choco install nodejs
like image 29
mikey Avatar answered Oct 21 '22 18:10

mikey