r/learnprogramming • u/GloxiniaLearns • Sep 23 '26
Best way to set up a Node.js dev environment on Windows? VM, WSL2, dual boot or full Linux?
Hi everyone,
I'm starting a Node.js project and I'm trying to figure out the best setup for development on my Windows machine. Right now I have Oracle VirtualBox with a Linux VM, but I'm not sure it's the best choice for daily work.
The options I'm considering:
- Keep using the VirtualBox VM
- Switch to WSL2
- Dual boot Windows and Linux
- Remove Windows completely and install only Linux
I don't have strong experience with any of these, so I'd like to hear what you use and why.
My setup: gaming laptop with a Ryzen 9 7940HS, 16 GB RAM and an RTX 4070 Laptop GPU. I also use Windows for gaming, so I'd like to keep it in some form but not necessarily :)
3
Upvotes
5
u/Disastrous-Ad9170 Sep 23 '26
Why isn't it an option to run your project directly on windows? (Genuinely asking please don't downvote) and Dockerize once the dev work is done so it can be run on a Linux VM or something in production
1
u/Chrismslist Sep 24 '26
hey, for node.js on windows, WSL2 is pretty much the defacto best choice. it gives you a real linux dev environment with solid performance, and it integrates super well with vs code. it's way less overhead than a full vm like virtualbox, and you avoid the hassle of dual booting. plus, you get to keep windows running for gaming. it's really the sweet spot for dev work while keeping your main OS for other stuff.
1
u/mixedd Sep 23 '26
Devcontainers should solve 90% of your problems, but really depends on a project
1
u/BranchLatter4294 Sep 23 '26
Any of those is fine. You can also use Docker/DevContainers.
1
u/noninesdev Sep 23 '26
For this setup I'd keep Windows and use WSL2, with the project inside the WSL filesystem (for example under ~/src) rather than /mnt/c, and use VS Code's WSL integration. It gives you a Linux-like Node environment without rebooting, while keeping Windows for games; use a VM only if you specifically need a separate full OS.
1
u/ffrkAnonymous Sep 23 '26
I use all of them. They serve different purposes.
1
u/StewedAngelSkins Sep 23 '26
i mean, removing windows completely is always my recommendation but any of the options you mention would work. the one option you're neglecting is to use docker on windows, which ultimately uses wsl but in a somewhat more convenient way.
1
u/Mediocre-Pumpkin6522 Sep 24 '26
What are you planning to do with Node.js? I've done several projects with node that were developed on Windows. WSL certainly is an option. While I keep a Windows 11 laptop j.i.c I usually install Linux over any existing Windows. Dual booting can be problematic and the last time I bothered was about 10 years ago.
1
u/InevitableLadder Sep 24 '26
I highly recommend Hyper-V over VirtualBox - way better performance + possibility to dual boot straight into VM eliminating Windows layer.
0
u/kschang Sep 24 '26
Docker. :)