Skip to content

Uninstall fnm

If you need to uninstall fnm, please follow the steps below.

Quick Uninstall

Using the Uninstall Script

fnm provides a convenient uninstall script:

bash
curl -fsSL https://fnm.vercel.app/uninstall | bash

This script will automatically:

  • Delete the fnm binary
  • Clean up the fnm directory (~/.fnm)
  • Prompt you to remove fnm-related code from your Shell configuration

Manual Uninstall

If the uninstall script doesn't work properly, you can uninstall manually.

Step 1: Delete fnm Directory

fnm stores all files in the ~/.fnm directory by default:

bash
rm -rf ~/.fnm

Step 2: Delete fnm Binary

Depending on the installation method, the fnm binary may be located in different places:

bash
# Homebrew installation
brew uninstall fnm

# Manual installation (check common locations)
rm -f /usr/local/bin/fnm
rm -f ~/.local/bin/fnm
rm -f ~/bin/fnm

Step 3: Clean Shell Configuration

Remove fnm-related configuration from Shell configuration files:

bash
# Edit ~/.bashrc, remove the following line
eval "$(fnm env --use-on-cd)"
bash
# Edit ~/.zshrc, remove the following line
eval "$(fnm env --use-on-cd)"
bash
# Edit ~/.config/fish/config.fish, remove the following line
fnm env --use-on-c | source
powershell
# Edit $PROFILE, remove the following line
fnm env --use-on-cd | Out-String | Invoke-Expression

Step 4: Reload Shell

bash
# Bash
source ~/.bashrc

# Zsh
source ~/.zshrc

# Fish
source ~/.config/fish/config.fish

# PowerShell
. $PROFILE

Platform-Specific Uninstall Guide

macOS

bash
# Homebrew installation
brew uninstall fnm
rm -rf ~/.fnm

# Remove fnm-related lines from Shell configuration

Windows

Using winget

powershell
winget uninstall Schniz.fnm

Using Scoop

powershell
scoop uninstall fnm

Using Chocolatey

powershell
choco uninstall fnm

Manual Deletion

  1. Delete fnm directory: %USERPROFILE%\.fnm
  2. Remove fnm path from PATH
  3. Clean up PowerShell profile

Linux

bash
# Delete fnm directory
rm -rf ~/.fnm

# Delete binary (depending on installation location)
rm -f /usr/local/bin/fnm
rm -f ~/.local/bin/fnm

# Clean Shell configuration
# Edit ~/.bashrc or ~/.zshrc

Keep Node.js Versions

If you want to keep installed Node.js versions, you can backup before uninstalling:

bash
# View fnm directory structure
ls -la ~/.fnm

# Backup node versions (if needed)
cp -r ~/.fnm/node-versions ~/node-backup

Verify Uninstall

Confirm fnm is completely uninstalled:

bash
# Should output "command not found" or similar error
fnm --version

# Check if fnm directory is deleted
ls ~/.fnm

Common Issues

Shell Startup Error After Uninstall

If Shell reports errors after uninstalling, check if there's still fnm-related code in configuration files.

fnm Path Still in PATH

Check and edit Shell configuration file to remove all fnm-related PATH settings.

Want to Reinstall fnm

You can reinstall fnm anytime after uninstalling:

bash
# macOS/Linux
curl -fsSL https://fnm.vercel.app/install | bash

# Windows
winget install Schniz.fnm