- Published on
WSL2 Install FNM(Fast Node Manager)
- Authors
- Name
- Piggy DP
- @xiaozhudxiaozhu
To install fnm
(Fast Node Manager) on WSL2, follow these steps:
Open WSL2: Start your WSL2 terminal
Install fnm: You can install
fnm
using a script provided by the maintainers. Run the following command:curl -sSfL https://fnm.vercel.app/install | bash
Add fnm to Your Shell: After the installation, you need to add
fnm
to your shell profile. If you're usingbash
, add the following lines to your~/.bashrc
file:export PATH="$HOME/.fnm/node-versions/node/v$(fnm current)/bin:$PATH" eval "$(fnm env)"
If you're using
zsh
, add it to your~/.zshrc
instead.Reload Your Shell: To apply the changes, reload your shell configuration:
source ~/.bashrc
Or for
zsh
:source ~/.zshrc
Verify the Installation: Check if
fnm
is installed correctly by running:fnm --version
Install Node.js: Now you can install Node.js versions using
fnm
. For example, to install the latest LTS version:fnm install --lts
Use a Specific Version: To set a specific version of Node.js, you can use:
fnm use <version>
You should now have fnm
installed and ready to manage your Node.js versions on WSL2.