Setup Guide for Mac Users
Here are the steps in overview. Make sure you have a decent internet connection as a lot of downloading (mostly automated, thankfully!) is required.
- Install and setup Xcode command line tools
- Install Node.js
- Install Visual Studio Code
- Install packages
We’ll be using your computer’s "Terminal" or "command line" for some of these tasks, so if you aren’t familiar with it, read more on how to use the Mac Terminal. For these steps, you’ll only need to copy and paste snippets into your command line.
1. Install and setup Xcode command line tools
To install, you can run:
$ xcode-select —install
If prompted, accept the license terms.
2. Install Node.js
Node.js allows you to run Javascript code separate from a browser. Node.js uses the same Javascript engine as Google Chrome, and has a huge library of "packages" available which make programming easier.
It's a little bit complicated, but we'll install Node.js via a tool called nvm. If you have trouble installing NVM, please check their website.
Run these commands at the Terminal:
$ touch ~/.bash_profile
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
As instructed, close the Terminal window and open a new one. Now we can use nvm
to install Node.js:
$ nvm install node
$ nvm use node
If you get an error such as "command not found", it means that nvm
was not installed properly. Before proceeding, please try to get it installed.
If nvm
works, now test that it installed Node.js properly:
$ node --version
node v6.0.0
You should see the version printed (and it should be at least v6). If you get an error such as "command not found", it means Node.js has not been installed properly. Please attend to any errors and read further nvm documentation.
3. Install Visual Studio Code
Visual Studio Code is a text editor well suited for web development tasks. It’s also happens to be made with web technologies (HTML and Javascript) so its a great example of how far you can take the skills you learn.
4. Install packages
We’ll need to install a few packages for Node.js using npm, the Node Package Manager.
$ npm install -g live-server
The -g
option installs packages globally. If there is a failure installing a package, you could try re-running the command. npm
will skip over packages it has already installed.