Make sure to check out Part One, How To Install Apache on macOS 10.15 Catalina Using Homebrew, which is a pre-requisite for this piece. In the past, I used to rely on the version of Apache and PHP that came pre-loaded with the OS on my MacBook Pro. I would then install the PHP extensions I needed (Xdebug, Redis, etc.) from Homebrew. Install Git Using Homebrew. Another way to install Git is with Homebrew, the package management system for Mac. Run the following brew command in the terminal: brew install git. Then, check the Git version to verify the installation: git -version Install Git Using MacPorts.
Install Brew In Mac Catalina 2019
In this tutorial we will learn to install TypeScript on Mac using NPM a NodeJS package manager.
Step 1: Install Homebrew
Install Brew In Mac Catalina Update
Homebrew is a package manager for Mac and helps to easily install and uninstall softwares on a Mac.
To install Homebrew run the following command in the terminal.
For more detail on Homebrew check their website.
Once you have homebrew installed on your system you can use it to install many packages.
Step 2: Install Node
By installing NodeJS you will also get NPM which is Node package manager. It will help you to install other packages.
To install Node on your Mac using Homebrew type the following command.
Once you have Node installed you can check its version by typing the following command in the terminal.
And, to check the version of NPM type the following command in the terminal.
Click here to read the tutorial on How to install NodeJS on Mac.
So, now we have Node and NPM installed on our system. Time to install TypeScript using NPM.
Step 3: Install TypeScript
We will install TypeScript globally on our Mac so that we can access it from any directory. For this we will use the following command.
You may have to use
sudo
if you don't have permissions.Output
Once you have TypeScript installed use the following command to check the version.
Output
Using TypeScript to convert .TS file into .JS file
Lets say, we have a project folder example and we have an app.ts TypeScript file which we want to convert into JavaScript file.
The content of app.ts file is given below.
To convert app.ts file into app.js file we use the following command in the terminal.
Output
![Install Brew In Mac Catalina Install Brew In Mac Catalina](/uploads/1/3/4/8/134880499/820705760.png)
Uninstall TypeScript
To uninstall TypeScript globally we use the following command.
You may have to use
sudo
if you don't have the permissions.Output
And that's all for this tutorial. Have fun coding.