How to Setup Your M1 MacBook for Web Development
Tags: fewdaily, webdev, news, macbook
Published: 2021-01-26 11:06:02

{% spotify spotify:episode:4Bi9zXKB9sUjrl9JqQ2FEC %}

---

The worst part (or perhaps the most fun for some) of getting a new laptop is setting up everything you need as a web developer. Adding programs and tools that you had installed over the many years of ownership of your previous laptop can seem daunting. With the release of the new Macbook M1 laptops, there are some interesting new considerations as well that you may not be aware of. So, let's jump in and get the basics set up so you can hit the ground running developing your next project.

## Rosetta 2

The first thing you should install is [Rosetta 2](https://developer.apple.com/documentation/apple_silicon/about_the_rosetta_translation_environment), which allows you to run Intel-based software on the new ARM chip. Because Apple has created their own chips they needed a way to provide backward compatibility with programs that do not yet support ARM and Rosetta 2 is that solution.

`/usr/sbin/softwareupdate --install-rosetta --agree-to-license`

## Homebrew

[Homebrew](https://brew.sh/) will be the best way to add the other software and tools on our computer, so we want to install that next. A quick tip that is good to know is when you go to open the built-in Terminal in the Applications folder: right-click, select *Get Info,* and check the *Open with Rosetta* box.

`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`

## Tools

There are a lot of tools to consider when setting up your Macbook from scratch, so one of the quickest ways to add a lot of the important ones is to use a script. I recommend [the script created by the author](https://github.com/CxGarcia/setup) of the original post that this is based on, but feel free to use a different one or modify this one for yourself.

Opening the downloaded script folder in your terminal you can choose to run the install script or modify what will be installed from the brew-installs.sh file. Once you're satisfied, run the script.

Some of the tools and applications included in the script are:

* MongoDB
* node
* git
* zsh
* Firefox
* Chrome
* VSCode
* Zoom
* Slack
* Discord
* Notion
* and more...

`./brew-installs.sh`

**Note:** if it doesn't work try running `chmod +x brew-installs.sh` first

## nvm

Something that is not included in the script is [nvm](https://github.com/nvm-sh/nvm) because there have been difficulties installing this with the ARM chip. To get around this you will have to use a `curl` command and make a couple of modifications afterward.

`curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash`

In your .zshrc file (.bash-profile or .bashrc for bash):

```
export NVM_DIR="$HOME/.nvm"
#This loads nvm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
#This loads nvm bash_completion
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
```

## Git and GitHub

Git was installed with the brew install script so make sure to configure the settings and [use a personal access token to authenticate GitHub](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token).

```
git config --global user.name < USERNAME > &&
git config --global user.email < EMAIL > &&
git config --global --list
```

## VSCode

Make sure to use the [Settings Sync plugin](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync) to keep all of your VSCode settings in sync with a stored GitHub gist.

## Conclusion

You should now be all set to start developing! Thanks to the script many tools and applications were installed for us, minimizing the manual install process.

## Credit

*Today’s Tuesday Tips was adapted from [a post on the Logrocket blog](https://blog.logrocket.com/set-up-macbook-for-web-development-in-20-minutes/).*

---

Want to know more? Head to [fewdaily.com](https://fewdaily.com) for more of today’s topics and other front-end web content! If you liked what you heard be sure to rate, review, and subscribe on your platform of choice. That's all for today, tune in tomorrow!