Background
In previous posts, we saw how to install node directly using the installer in Windows and on Linux using apt-get command. In this post, we will see how to use a package manager called fnm (Fast Node manager) on Windows.
Install Node and NPM on Windows using fnm package manager
- Open your PowerShell window
- Run command : winget install Schniz.fnm
- This will install the fnm version manager
- Before you use fnm you need to do a few terminal settings
- Run the command "new-item -type file -path $profile -force" to create your profile file.
- Then run the command "notepad $profile" to open your profile file.
- Add the below line to the opened Notepad file and save it
- fnm env --use-on-cd | Out-String | Invoke-Expression
- Once done you can install the node using the following command
- fnm use --install-if-missing 20
- Once run you can check the installation by running the following commands
- node -v
- npm -v