Managing Node Versions
Managing node versions is important for ensuring that different projects can run with the appropriate version of Node.JS.
Classically I used two different tools to manage node versions:
- NVM - a set of bash scripts for MacOS and Linux and
- NVM-Windows - a command line utility for Windows.
This quickly grew annoying as they operated slightly differently, and on Windows I like to use multiple accounts to split work and personal projects, which was not compatible with NVM-Windows.
The Solution: mise-en-place ( or just "mise" )
Mise is a cross-platform tool for managing a wide range of development tools, including Node.JS. Being cross-platform, it works the same way on both Windows and Unix-based systems, making it easier to manage node versions across different environments. It also allows for per-project node versions, which is a great feature for ensuring that each project uses the correct version of Node.JS without affecting other projects.
Installation
Install Mise using your package manager of choice depending on your operating system:
brew install mise # For MacOS
winget install jdx.mise # For Windows
sudo add-apt-repository -y ppa:jdxcode/mise && sudo apt update -y && sudo apt install -y mise # For Ubuntu/DebianActivation
Mise needs to be activated in your shell configuration file. Add the following line to your .bashrc, .zshrc, or equivalent shell configuration file:
echo 'eval "$(mise activate zsh)"' >> ~/.zshrc # For Zsh
echo 'eval "$(mise activate bash)"' >> ~/.bashrc # For Bashor windows:
# create profile if it doesn't already exist
if (-not (Test-Path $profile)) { New-Item $profile -Force }
# open the profile
Invoke-Item $profile
# add this line
(&mise activate pwsh) | Out-String | Invoke-ExpressionUsage
Install Node globally:
mise use --global node@24Install Node for a specific project:
cd my-project
mise use node@18When installed in a project Mise will generate a project file in the directory, meaning other users can simply run mise use to get the correct version of Node.JS for that project.