How to code on Windows, but run dev tools on Linux?
Sometimes you may face a project that is written in an exclusive way that supports only Linux (and Mac). It means that as Windows user you may be blocked from working on the project.
One option is to fix project configuration to make it cross platform. Other way would be to cash out on a Mac computer, or install Linux. Both ways has a downside of having to spend precious time to learn a new system.
But there is another option. You can install Linux on Windows. That way Linux will become basically a command prompt you can use. From that Linux you can access your project on your normal Windows drive on your normal FAT or NTFS partition. You can still use VSCode and your favorite software, while making sure the project’s tools will be handled from Linux.
To do so:
- Have Windows 10 or 11
- Go to Store, and install Linux subsystem
- Open the subsystem console
- Access your files by using cd /mnt/c (where c is your c drive)
Then you can install what you want from the Linux console. Especially you’d have to remove node_modules and install them from Linux in case a module is browser dependent.
When you will clone the project, and set it up, you can use npm, node and so on from Linux.
On the other side you can still access your project as a regular folder from Windows, using for example VSCode.
That way you have the best things from both worlds: Windows, and a Linux console to deal with exclusive projects.
Surprisingly, you don’t have to use Linux or Mac to handle any project. Windows is perfectly capable to deal with this.