You will need to install certain tools that will be used throughout the course.
Install a text editor
Visual Studio Code can be found here and is available for all platforms, but you are free to use any code editor you choose. Popular choices include Atom and Sublime Text.
Configure your text editor
a. Visual Studio Code
Start Visual Studio Code (Applications > Visual Studio Code
).
Press shift
+ command
+ P
to open the Command Palette.
Type shell command
, then in the displayed list, click Shell Command: Install 'code' command in PATH.
Close Visual Studio Code.
b. Sublime Text 3
Open your terminal (Applications > Utilities > Terminal
), paste the following command, and hit enter:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
c. Atom
No configuration needed.
Install brew
Brew is a package manager that we use to install various command line applications to your computer.
Open your terminal (Applications > Utilities > Terminal
), paste the following command, and hit enter:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Git
Git is used to track the state of your code over time. GitHub has built its platform on Git technology. We will be using both Git and GitHub to distribute code, submit assignments, and offer feedback. Use the following command to install Git:
brew install git
Configure Git
Copy and paste the following two commands (separately) into your terminal. Replace the name and email address values with your own.
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR EMAIL ADDRESS"
(source: GitHub)
Next, copy and paste one of the following commands into your terminal, based on which text editor you'll be using:
Visual Studio Code:
git config --global core.editor "code -w"
Sublime:
git config --global core.editor "subl -n -w"
Atom:
git config --global core.editor "atom -w"
Install Node
Refer to the package installer on Node’s website. Select the "Recommended For Most Users" version (labeled "LTS"). Then just follow the set-up instructions.
Ensure NPM is updated
Node has a handy package manager, which we will using frequently. It comes with Node, but NPM is updated more frequently; you will always need to have the most up-to-date version.
npm install npm -g
When you’re done, raise your hand and ask a member of the instructional team to verify that the installation was successful. Then complete the instructions in the section 2. Setting up GitHub below.
We will be using the GitHub Enterprise service to share some of our code. We will learn
about the underlying technology of GitHub known as git
in the next lesson.
Note: If you already have an SSH key set up in git (for instance, for a personal or work account on github.com), use the steps in Configuring Git to use Multiple Accounts (Mac) instead of those below.
ssh -T git@git.generalassemb.ly
You should see output similar to:
Hi <you>! You've successfully authenticated, but GitHub does not provide shell access.
Connection to git.generalassemb.ly closed.
Error installing due to permissions
Permissions issues are common when installing programs on the terminal. In order to install command line utilities, you need to be signed into a user account on your computer with administrator-level rights. If you have trouble with this, please ask a member of the instructional team for help.
Google is your friend
Even experienced programmers occasionally need to look up error messages on Google. If you experience an error, it’s likely that someone else has experienced the error, as well. To find the fix, copy and paste the error message into Google, but remove content specific to your computer to ensure the accuracy of your search. You will most likely find a reference to your specific error. StackOverflow is a trustworthy reference.
Common Issues and Fixes:
EACCES
error: change directory permissions to install Node and npm without the need to use sudo:
sudo chown -R $(whoami) /usr/local/lib/node_modules
Permission denied (publickey)
: Use the following command to manually add the key to the keychain:
ssh-add -K ~/.ssh/id_rsa_ga
Then retry your previous command.
Existing GitHub account that uses SSH (and existing id_rsa file): save your new key as ~/.ssh/id_rsa_ga
, and then edit the git config
file as follows:
.ssh
folder, then open the file named config
(if this file doesn't exist, go to the terminal, run touch ~/.ssh/config
, then open the file in your editor.)# my GitHub account Host personal HostName github.com User git AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes # GA github Enterprise Host GA HostName git.generalassemb.ly User git AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa_ga IdentitiesOnly yes # wildcard Host * AddKeysToAgent yes UseKeychain yes