This guide provides a simplified, step-by-step process for setting up your local environment with specific tool versions.
- This guide assumes a MacOS installation. Please refer to your system for specific steps.
- Homebrew installed
- Docker Desktop installed and running
Follow these steps in order:
We use pyenv to manage Python versions needed for Node.js builds.
- Install
pyenv:brew install pyenv - Configure
pyenv: Add the following lines to your~/.zshrcfile:
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"- Apply changes:
source ~/.zshrc
- Install Python 3.9.x:
pyenv install 3.9.18 - Set as global (temporarily):
pyenv global 3.9.18
nvm is used to manage multiple Node.js versions.
- Install
nvm:brew install nvm - Configure
nvm: Add these lines to~/.zshrcbefore thepyenvconfigurations:
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
[ -s "/opt/homebrew/opt/nvm/etc/_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/_completion.d/nvm"- Apply changes:
source ~/.zshrc - Install Node.js:
nvm install 14.19.2 - Set as default:
nvm alias default 14.19.2
- .NET 8 SDK:
brew install dotnet-sdk@8 - Terraform 1.4.6:
brew install terraform@1.4.6
For older versions of Node.js, using Docker provides an isolated, pre-built environment.
-
Create a
Dockerfilein your project root:FROM node:14.19.2-slim WORKDIR /app COPY package*.json ./ RUN npm install COPY . . EXPOSE 3000 CMD ["npm", "start"]
-
Build the image:
docker build -t your-app-name:1.0 . -
Run the container:
docker run -p 3000:3000 -v "$(pwd)":/app your-app-name:1.0
- Reset Python: After a successful Node.js installation, you can revert
pyenvto your system's default Python:pyenv global system