Skip to content

Instantly share code, notes, and snippets.

View devdavedotdev's full-sized avatar
🎯
Focusing

devdave devdavedotdev

🎯
Focusing
View GitHub Profile
@devdavedotdev
devdavedotdev / Node version switch automation for windows.md
Last active November 15, 2024 23:58
Automated Node Version Switching for Windows using NVM

Automated Node Version Switching for Windows using NVM

Introduction

Managing multiple versions of Node.js can be cumbersome, especially when working on different projects that require different versions. On Unix-based systems, nvm (Node Version Manager) allows users to switch between different versions of Node.js seamlessly. However, on Windows, nvm behaves differently and does not automatically switch versions based on the .nvmrc file. This script automates the process of switching Node.js versions on Windows using nvm-windows.

Script

# Load nvm and automatically use the Node version specified in .nvmrc
load-nvmrc() {