Install Node JS
Install Scoop
Scoop is a command-line package manager for Windows that simplifies the process of installing, updating, and managing software on a Windows system. It's similar to package managers like apt for Linux or brew for macOS but specifically designed for Windows environments.
Open up the Terminal as Admin by right clicking on the start menu and selecting the option for "Terminal (Admin)". Then set the execution policy
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
This command is often used to allow PowerShell scripts to run on a system where the default policy (often Restricted) prevents script execution, especially useful when installing tools or working with automation in PowerShell.
Close the Admin terminal, and reopen the terminal without Admin rights. Then install Scoop
iwr -useb get.scoop.sh | iex
Install FNM
FNM (Fast Node Manager) is a tool for managing multiple versions of Node.js. It functions similarly to tools like nvm (Node Version Manager), allowing developers to easily switch between different versions of Node.js on their system.
Use Scoop to install FNM
scoop install fnm
Add the specified command to the path. First, ensure a powershell profile exists
if (!(Test-Path -Path $PROFILE)) {
New-Item -ItemType File -Path $PROFILE -Force
}
The script checks if the PowerShell profile file exists for the current user. If the profile file doesn't exist, it creates an empty profile file at the path specified by $PROFILE
. Now open the powershell profile
notepad $PROFILE
Add the specified command to the profile, save it, then close it
fnm env --use-on-cd | Out-String | Invoke-Expression
Close the terminal then reopen it so that the changes take effect.
Install Node LTS
In the terminal, use FNM to install the Long Term Service (LTS) version of Node
fnm install --lts
Confirm Node has been installed
node -v
(Optional) Install Yarn with Corepack
To install Yarn, enable corepack
corepack enable
Then initialize Yarn
yarn init -2
Confirm Yarn has been installed
yarn --version
If you see a version printed, Yarn is now installed.