This tutorial explains how you can install the nano text editor on a Windows PC. I will show two different methods.
In the first method, we will use Chocolatey to install nano. If you have not installed Chocolatey, open PowerShell and run the following command to install Chocolatey.
[Method 1] : Use Chocolatey to install Nano on Windows
Step 1: Install Chocolatey using Powershell command
powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Step 2: Install Nano using Chocolatey command
choco install -y nano
[Method 2]: Use Virtual Machine to install Nano
For the second method, the only prerequisite is that your system has to have Bash (a shell) installed!
If Bash is not yet present on your machine follow these steps:
Step 2. Install any version of Ubuntu 16.04 LTS
copy all files from [your current working directory]/bash onto /mnt/c/Users/*YOUR_USERNAME*/AppData/.wsl/bin/bash
Step 3. Change the file
/mnt/c/Users/*YOUR_USERNAME*/AppData/.wsl/etc/defaults/apparmor from “deny” to “allow”. This allows more open access for WSL and Bash on Windows 10 Home.
Step 4. Open a command prompt and navigate to
[your current working directory]/.bash . Type wsl and hit enter:
You have successfully set up an environment where you can easily install nano! Now we want to update nano’s git repository with nano’s master branch. If it is not already installed, type
sudo apt update && sudo apt upgrade in the terminal window:
Now nano has been updated to its latest version.
Step 5. Type nano into your terminal window and hit enter to verify that nano is now installed.
Congratulations, you have successfully installed nano on Windows!
[Method 3]: Install Nano through Zip file
Step 1: Download zip file from nano-editor.org and upload the .gz file on your desktop.
Step 2: Copy nano.exe file in your Windows folder. This will let you run the nano directly from the command prompt.
If you are not comfortable with copying an .exe in your Windows folder, you can set the path of Nano in an environment variable.
Add Nano to environment path
Step 1: Copy the path to the nano.exe
Step 2: Open Settings >> Environment Variable
Step 3: Click on “Environment Variable” Button
Step 4: Add a new entry to the Environment
Step 3: Open the command prompt and run Nano to confirm the installation