- Read Tutorial
- Watch Guide Video
Before we can install typescript on our system we first need a package manager in order to do the hard work for us. So what we're going to do in this guide is install homebrew on our systems. If you are not familiar with homebrew you can think of it as a type of ruby gem or a type of package manager.
Package Managers
If you've worked with other languages such as JavaScript and node, node has the NPM, which stands for node package manager and if you've worked with Python it has PPM which stands for the Python package manager. So every language and system usually has one or multiple kinds of package managers, and this makes it a lot easier than installing the software yourself. We could go to the typescript home page and simply download the software, then be able to integrate the compiler and or the interpreter on our systems. However we could run into some problems if we have some system components that are a little bit different. So say we have a few older libraries on our system. They may actually conflict with what we are trying to do. What homebrew does is it takes care of not just what we're trying to install but also it manages that tendencies between that and everything else on our system. So it's a great tool to use. To find it, go to brew.sh and simply copy and paste this code right here. Now if you open up the terminal you can paste this in.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now if you have an older version of homebrew or you've never installed it on your system what you're going to see on my screen, is going to be much different than what you will see on your screen. I already have an updated version of homebrew but I'll pass this and I'm going to hit return.
It's going to ask me if I want to install all of these items you can see here.
It's going to install inside my user directory. Some of binary files for homebrew, and some site functions, things like that. Now if I hit return this is going to go out to the web and it's going to grab all of those items, and if I had anything to update it would run through that process. I have had it take as long as 5 or 10 minutes. I already had the most up to date version or a homebrew so it happened very quick and you can see it says instillation successful.
No matter how long it takes on your specific system it will have worked if you can see that it says installation successful here. It also gives you some next steps so I could type in "brew help", and if this prints out the help messages it means that this is working on the system.
The other nice thing about what homebrew does is it also built in this brew command inside of the terminal, which you would not have had before. So it does a lot of that work for you. You also have some things like Brew doctor, which I've used before for troubleshooting. Brew update is a way that you can update your version of homebrew. That's usually something that's really good to do on a regular basis. I usually do mine every few weeks or so. I definitely recommend for you to explore these a little bit. But now that you have that installed in the next guide we're going to be able to actually install typescript.