Install Node JS (Windows)
How to install Node.js with Scoop and FNM on Windows.
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 CurrentUserThis 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 | iexInstall 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 fnmAdd 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 $PROFILEAdd the specified command to the profile, save it, then close it
fnm env --use-on-cd | Out-String | Invoke-ExpressionClose 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 --ltsConfirm Node has been installed
node -v(Optional) Install Yarn with Corepack
To install Yarn, enable corepack
corepack enableThen initialize Yarn
yarn init -2Confirm Yarn has been installed
yarn --versionIf you see a version printed, Yarn is now installed.