Downgrade Node Js version
Asked Answered
C

5

5

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.

Crowther answered 30/5, 2022 at 4:28 Comment(5)
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?Propositus
The best is to uninstall nodejs completely from your PC and install nvm github.com/nvm-sh/nvm and nvm makes our life so easy to switch node versions easily.Gourde
Your OS is Linux / Windows / Mac?Pompey
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.Broeder
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?Indeterminate
E
5

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.

Execrative answered 20/11, 2022 at 11:18 Comment(0)
U
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

Ungula answered 30/5, 2022 at 4:37 Comment(1)
While this is useful, a better answer would have included an example.Alligator
A
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.
Alligator answered 12/8, 2022 at 2:57 Comment(0)
I
0

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

https://nodejs.org/dist/

Isahella answered 25/11, 2022 at 4:43 Comment(0)
G
-1

n is the simplest package to manage your node versions.

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

Gonsalve answered 30/5, 2022 at 5:19 Comment(1)
Not a answer! He is trying using n. n is not for Windows...Broeder

© 2022 - 2024 — McMap. All rights reserved.