Node.Js on Windows in 2023 - Tools and tricks
Tags: node, beginners, tutorial, productivity
Published: 2023-11-05 20:12:15

In 2023, Node.js continues to be a game-changer in the world of web development, and for Windows users, harnessing its potential efficiently is more crucial than ever. Whether you're a seasoned Node.js developer or just embarking on your coding journey, this post is your essential guide to mastering Node.js on the Windows platform. We'll delve into the tools and tricks that can enhance your development experience, making it smoother and more productive. Get ready to turbocharge your Node.js journey and make the most of your Windows environment!

## WSL 2
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fe0yniu9wwwarh3tzeuz.png)

Windows Subsystem for Linux 2 (WSL 2) is a technology that allows you to run a full Linux kernel on your Windows machine. It offers improved performance and compatibility compared to its predecessor, WSL 1, making it a valuable tool for developers who need to work with Linux-based software on their Windows systems. WSL 2 seamlessly combines the Windows and Linux environments, providing a versatile solution for development tasks.

To install it open the Windows Powershell and run:

```bash
wsl --install
```

After installing reboot your PC.

> Remember to enable virtualization on your BIOS.

Now open the Microsoft Store and search for Ubuntu(or any other Linux distro supported by WSL), click on install.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ntsyr6ogzeye9gopc8ou.png)

## Windows Terminal
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fq85g9aihdomjvm15ym3.png)

Windows Terminal is a modern and powerful command-line interface for Windows that offers a more versatile and user-friendly experience for developers and system administrators. It consolidates various command-line tools, shells, and scripts into a single application, enabling you to work with PowerShell, Command Prompt, and even Linux distributions through WSL.

Search on Microsoft Store and install it (maybe it is already on your system).

## Oh My Zsh
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/49r2umj7t4z4bqkw0itr.png)

Zsh, short for Z Shell, is a highly customizable and powerful command-line shell that serves as an excellent alternative to the default shells like Bash or PowerShell. With a user-friendly and feature-rich environment, Zsh is popular among developers and power users for its extensive plugin support, auto-completion, and a plethora of productivity-enhancing features.

To install it, open the Windows terminal click on the dropdown arrow, and select Ubuntu.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/52in71tte5p4s49rezj0.png)

Now we are in a Linux! Maybe it take a while for the first time, then will ask you for a username and a password. When finished we will see or prompt ready, let's install the ZSH and OMZ:

 ```bash
 sudo apt install zsh
```
When ask for your password type it and hit enter.

Now install the OMZ:

```
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
The script will ask to change the default shell, type "y" and hit enter.

## Shell font
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/260vn4worzdab849946o.png)

We need some custom font to use with our shell theme, the new font will support some "icons" to improve the experience (really?).

You can get one [here](https://www.nerdfonts.com/font-downloads), I recommend the Cascadia Code.

After downloading, extract it and double-click to install.


## Starship
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gs51ytfpu3mt1zk9syq4.png)

Starship is a sleek and highly customizable command-line prompt that enhances your shell experience by providing a visually appealing and informative prompt. It's designed to work with various shells, including Bash, Zsh, Fish, and PowerShell, and offers a wide range of features to make your command-line interactions more efficient and enjoyable.

To install run this command:

```sh
curl -sS https://starship.rs/install.sh | sh
```
Type "y" and hit enter when asked, after:

```sh
eval "$(starship init zsh)"
```

Now you can get a preset or a theme or even create one, just [check the documentation here](https://starship.rs/presets/#nerd-font-symbols)

## Node.js
Let's install Node.js but we will use the `nvm`, which is a Node version manager, so you can install any version of Node.js with no problems or conflicts.

```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

source ~/.zshrc
```

Now, to install the LTS version:

```sh
nvm install --lts
```
> Change "--lts" for a specific version number if you want

## Conclusion

Now you are ready to go! Pick your favorite code editor and go on!
I recommend the Visual Studio Code cause it has an awesome integration with WSL system.