skip to Main Content

How to downgrade Node.js version from 21 to 20 using Node Version Manager (NVM)?

I am working on a project that requires Node.js version 20.x.x. However, my development environment is configured with Node.js version 21.6.1. I need to downgrade Node.js to version 20 using Node Version Manager (NVM) in my Visual Studio Code terminal.

Could someone please provide step-by-step instructions on how to accomplish this task?

I’m looking for guidance on how to:

  • Install Node Version Manager (NVM) if it’s not already installed.
  • Download and install Node.js version 20 using NVM.
  • Set Node.js version 20 as the active version in my Visual Studio Code terminal.
  • Verify that the installation was successful and I’m now using Node.js version 20.

enter image description here

2

Answers


  1. knowing nvm made my life actually better :). To install:

    1. Follow this wonderful article https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/. Get used to bash scripting, you will need it more than you think onwards.
    2. If you can execute nvm --version on your terminal, then it is properly installed.
    3. To install the node version you want, just execute nvm install <<version>>. So for node 20.1.5, you can execute nvm install 20.1.5.
    4. Then execute nvm use <<version>> to use the node version.
    5. To check the node version, execute node --version.
    Login or Signup to reply.
  2. is there a better way to achieve this than downgrading, i am trying to experiment with strapi too

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search