Installing Node.js and NPM on a Mac
This lesson gives a step by step walk through for installing Node.js and NPM on a Mac.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

In the last video when I said we were going to install typescript next I jumped one step ahead of where we needed to go. You can't install typescript directly from homebrew we have to use an intermediary kind of step and that is with the node package manager. So after this is done you will have not only have installed homebrew for working with bringing in packages into your Mac but you'll also have the node package manager which is something specific to working with JavaScript and node based applications.

npm Website and Installation

So this is their Website, which is npm.js. However you don't really ever have to go to this one. A lot of it's mainly for their enterprise clients and things like that. However it's still good to know what is what or where it's at, and it has some nice spots for documentation and you can get some more information about what NPM is how to install different things like that. But because we have homebrew it's actually really easy to install. So in order to bring this in, all I have to say is brew Install node and this is going to bring the entire node library in for us. And here it says that I have to agree to the X code license which is perfectly fine if you're working with a Mac and you've built X code applications this may also be an error that you get. So I'm going to agree to this license. Make sure to actually put agree.

It looks like this is finally working so it's downloading from homebrew. It finished and if I scroll up. It says that there was an error but it doesn't look like they're actually forced it not to work. I think it just didn't bring in everything that needed to. But we can test it out and see if it brought in what we're going to need. So if you clear this and type in node –v you can see I'm working with version 5.6.0 and it should also brought in NPM. So if I type in npm –v this brought in NPM 3.6.0. It looks like all that we needed was installed those were just warning errors.

What we're going to need is the node package manager, and that's what installs typescript. It is also how we're going to get the server that is going to first, transcode our typescript files into JavaScript and second, our server that's going to run the applications in the browser and in the console. So as long as when you type in node –v and then npm –v if it's showing new versions it means that you should be good to go.