7

I want to downgrade the NodeJs version to 16 as some of the dependencies I am using in my React app do not support NodeJs 17. I tried this method (another post on stack overflow) also but this thing is not getting installed on my PC.

OS: Windows enter image description here

Any sort of help is appreciated. Thanks in advance.

smilyface
  • 5,021
  • 8
  • 41
  • 57
Tarun Sahnan
  • 79
  • 1
  • 1
  • 4
  • 1
    You need to use nvm (node version manager) to download the Node version 16, and then use it in your project. Which OS are you using? – Charchit Kapoor May 30 '22 at 04:32
  • The best is to uninstall nodejs completely from your PC and install nvm https://github.com/nvm-sh/nvm and nvm makes our life so easy to switch node versions easily. – Javascript Hupp Technologies May 30 '22 at 04:32
  • Your OS is Linux / Windows / Mac? – smilyface May 30 '22 at 05:26
  • Windows is not supported from `n` Just uninstall node.js and re-install the version you wanted. The error message you get is because the OS version check fails. `nvm` on the other hand is also not 100% compatible with windows. – Marc May 30 '22 at 06:56
  • I don't think downgrading to Node 16 is the correct approach, anyway. What are those dependencies that don't support a newer version of Node? – AKX May 30 '22 at 12:49

5 Answers5

4

Clearing the local installation of node, to find out where is and delete

where node

Install nvm

For Windows

For others

Show all the versions

nvm ls available

Install what you want

nvm install 16.11.0
nvm use 16.11.0

Check node version

node -v

I have tried several ways and this works, hope it helps.

Xuanming
  • 51
  • 1
3

You can use Node Version Manager(NVM).where you can downgrade or upgrade any node version. Please check

https://github.com/nvm-sh/nvm

Windows: https://dev.to/skaytech/how-to-install-node-version-manager-nvm-for-windows-10-4nbi Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04

0
  1. Install nvm (See link readme: Windows uses installer, Linux has a CLI copy+paste bash script).
  2. Restart the shell (if it was open when installed) to register the new path.
  3. If you want 14.18.1, for example: nvm use 14.18.1
  4. If you don't have it installed, it'll let you know. In that case: nvm install 14.8.1 -> repeat #3.
  5. node -v to verify.
miken32
  • 42,008
  • 16
  • 111
  • 154
dylanh724
  • 948
  • 1
  • 12
  • 29
0

Nodejs.org has previous releases versions in their distribution directory. Find the node version you need and install it.

https://nodejs.org/dist/

Tam Vo
  • 44
  • 2
-1

n is the simplest package to manage your node versions.

https://www.npmjs.com/package/n

Harsh Kanjariya
  • 503
  • 5
  • 11