Blog Thumbnail

How to use multiple NODE version on window

MN

Makara Nuol

21-10-2020 · 1 min read

Why Should You Use Node Version Manager?

Node version manager is useful when you need to work on multiple projects that require different versions of Node.js. This is common in scenarios like:

  • Maintaining legacy projects that use older Node versions
  • Developing new projects that use the latest Node version
  • Contributing to open source projects with specific Node requirements

Without Node version manager, you would need to constantly install/uninstall Node versions, which is inefficient and prone to errors

Requirements:

  • Git bash :https://git-scm.com/downloads
  • Text Editor

Getting start:

  1. Open your bash terminal

  2. Visit:https://github.com/Schniz/fnm

  3. Run install script

    curl -fsSL https://fnm.vercel.app/install | bash
  4. Apply changessource /path-to-your-file/.bashrc

    source /path-to-your-file/.bashrc
  5. Add below line in .bashrc to auto switch node version (.nvmrc / .node-version) fileeval "$(fnm env --use-on-cd)"

    eval "$(fnm env --use-on-cd)"

Useful Command:

Switch Node version

fnm use <node-version>

Checking node version

node --version