DEV Community

Cover image for The First Two Dev Tools Installed On My M1 Mac
Brian Douglas
Brian Douglas

Posted on • Edited on

The First Two Dev Tools Installed On My M1 Mac

I was overdue for an upgrade at my day job and recently received a 16 inch M1 Macbook Pro. If you work at Tech Company as a developer, you get provided a laptop for your daily development needs. Each company is different, but the typical time for a laptop refresh is about every 2-4 years. I contemplated what improvements I could make to my developer environment now that starting from a clean install. I wanted to share two changes I made with you.

Oh My ZSH

One thing to note is that the M1 mac was first announced in November of 2020 with zsh as the default shell. The previous version of bash shipped on mac had not been updated since 2007.

My usual strategy for setting up new dev machines is to copy my bashrc and bash_profile over the configs I've built up for the past nine years. Because the default environment is now zsh, I saw an opportunity to research some different tooling.

Oh My Zsh is a framework that has been around for some time and built on top of zsh. It is structured to allow plugins and themes and provide some basic shell environment settings from the start. With ease, you can leverage 275 plugins to install things like Go and Rust into your environment path.

Oh My Zsh is a delightful experience with a large open source community to help drive the framework forward. It comes bundled with thousands of helpful functions, helpers, plugins, and themes.

Some plugins worth looking into are the aws cli plugin for managing multiple profiles and framework-specific plugins like flutter for completion and aliases.

Volta

My go-to for Node version management had been nvm for years, it works how I expect it to, and I've never considered using anything else until now. You see, my expectations have been coerced into where they are today because I was able to learn Node the hard way (on the job). I never allowed the brain cycles to think about tooling, but while setting up my environment with an audience on Twitch, Volta came up as an alternative to my reach for nvm. I had t try it.

Volta is built in Rust and ships as a snappy static binary, which means you can install and run any JS tool quickly and seamlessly.

With Volta, you can select a Node engine once and lose the need to manage to load the correct version constantly. This was always a challenge for me when working on multiple projects in different terminals. In my past experiences, the version did not always line up, and I needed to include a nvm use command in my bash_profile to load the right Node when opening the terminal. Volta prevents that and the need to reinstall Node version on every upgrade.

Volta has a seamless, per-project version switching so you can switch between projects without manually switching between Node version. You can also install npm package binaries in your toolchain without having to periodically reinstall them or figure out why they've stopped working.

On most Unix systems, you can install Volta with a single command:

curl https://get.volta.sh | bash
Enter fullscreen mode Exit fullscreen mode

That command not only installs Volta, it also will append your path in your zsh so you can run volta install node right away.

Volta will also install your favorite package binaries as command-line tools without worrying about them interfering with your local development projects.

volta install netlify-cli
Enter fullscreen mode Exit fullscreen mode

Even better, these tools get pinned to a particular Node engine at installation time and don't change unless you explicitly tell them to. This means that once a tool works, it keeps working.

While contemplating the state dev tools in 2022, I got by using virtual environment tooling from Repl.it for quick sample projects and GitHub Codespaces for existing project work. I was surprised to see how long I could survive without installing anything and look forward to continuing to use those environments in future situations. I will provide more details in a post soon.

I am now curious, What are the first things you install on your new work computer?

Top comments (23)

Collapse
 
val1984 profile image
Valentin • Edited

I'm surprised no one mentioned Homebrew yet :)
brew.sh

Collapse
 
stripedpurple profile image
Nixua

Volta is great, I use it on my work windows machine, but for Mac and Linux my preferred is n by tj

github.com/tj/n

Collapse
 
bdougieyo profile image
Brian Douglas

Wow wasn’t aware of n.

Collapse
 
anthonyjdella profile image
Anthony

VSCode would be my 3rd dev tool 🤣

Collapse
 
nickytonline profile image
Nick Taylor

I've used n and nvm, currently back on n, but definitely going to check out Volta!

Collapse
 
gmarcos87 profile image
Marcos Gutierrez

Interesting, I did not know Volta. Every day I learn something new! Thanks for sharing.

Collapse
 
hipertracker profile image
Jaroslaw Zabiello

Before I used nvm for Node, rbenv for Ruby, pyenv for Python, etc. I replaced all with asdf asdf-vm.com/. It is clean, consistent and multiplatform.

❯ asdf list
crystal
  1.4.0
elixir
  1.13.3-otp-24
elm
  0.19.1
erlang
  24.3.2
  25.0-rc2
golang
  1.18
julia
  1.7.2
nodejs
  16.14.2
python
  3.10.4
ruby
  3.1.2
rust
  1.60.0
Enter fullscreen mode Exit fullscreen mode
Collapse
 
scanepa profile image
Stefano Canepa

The first 2 dev tools I installed on my MacBook Pro are: oh-my-zsh and vscode and then I went on with go, iterm2, brew, nvim, and podman. I actually should write and article about what I did in my first day back using a Mac

Collapse
 
yw662 profile image
yw662 • Edited

The per-project switching sounds great. Is it based on the engines field of package.json or some other configurations ?

Collapse
 
bdougieyo profile image
Brian Douglas

It is the engines field. docs.volta.sh/guide/understanding#...

Collapse
 
yw662 profile image
yw662 • Edited

That doesn't seem to be the engines field though.

Thread Thread
 
bdougieyo profile image
Brian Douglas

yeah, you are correct on that. Seems like Volta explains that here. github.com/volta-cli/volta/issues/...

Collapse
 
yw662 profile image
yw662

Actually I would prefer avoid Volta since it would introduce a private field in package.json which is not used and understandable by the rest of the world.

Thread Thread
 
bdougieyo profile image
Brian Douglas

Weird flex, but ok.

Thread Thread
 
yw662 profile image
yw662

Just imagine a better node version manager in the future. That new node version manager will have to support the Volta field even if it is not Volta.
Yet another weirdness like what we have been facing with :-).

Collapse
 
elzay profile image
El zay

Use asdf or brace yourselves for an nvm/volta/n for every single lang you deal with (nightmare)

Collapse
 
elzay profile image
El zay

will never use nor recommend a lang-specific version manager ever again

Collapse
 
brutalsimplicity profile image
Kory Taborn • Edited

Introducing, asdf, one version management tool to rule them all.

Welcome to the future.