How to change node version using nvm ?
This tutorial guides you on how to change node version using nvm. If you wanted to switch between Node setups or versions then you are at the right place.
How to change node version using nvm ?
Let’s say you are working on couple of Node projects and had installed multiple versions of Node setup on your machine. And you wanted to switch between Node versions based on the project that you wanted to run. It is possible and easy to change node version using nvm.
“nvm” stands for Node Version Manager. As the name suggests, you will be able to manage switching between different node versions easily using nvm.
First, check what is the default nvm and node version set on your machine by running the following commands.
To check nvm version.
$ nvm -v 0.38.0
And for checking node version.
$ node -v v6.14.4
Check node versions installed and available
To check node versions that you had installed, you need to run nvm list or nvm ls command as shown below
$ nvm list -> v6.14.4 v14.16.0 default -> v6.14.4 iojs -> N/A (default) unstable -> N/A (default) node -> stable (-> v14.16.0) (default) stable -> 14.16 (-> v14.16.0) (default) lts/* -> lts/fermium (-> N/A) lts/argon -> v4.9.1 (-> N/A) lts/boron -> v6.17.1 (-> N/A) lts/carbon -> v8.17.0 (-> N/A) lts/dubnium -> v10.24.1 (-> N/A) lts/erbium -> v12.22.3 (-> N/A) lts/fermium -> v14.17.3 (-> N/A)
From the above response, it is understood that there are two versions of Node installed on your machine (v6.14.4 & v14.16.0). And in that the v6.14.4 has been set as default. And let’s say you wanted to switch from v6.14.4 to v.14.16.0.
All you need to do is just run the following nvm use command to change the node version using nvm.
$ nvm use v14.16.0 Now using node v14.16.0 (npm v6.14.11)
Therefore, from the response above you could see that now your machine is using node v14.16.0.
Also, you can verify whether node version is changed by running the following command.
$ node -v v14.16.0
That’s it. You had learnt how to change node versions using nvm.
Hope it is helpful 🙂
Also see:
- Call ngOnInit() again from another function – Angular 9 ?
- ngOnChanges get new value and previous value – Angular
- Global Angular CLI version is greater than your local version
- Upgrade Angular CLI to the latest version Angular 9 or 10 ?
- How to use new static option in ViewChild Angular 9 ?
- Project contents into angular components using ng-content
- Call ngOnInit() again from another function – Angular 9 ?
- ngAfterContentInit with Example – Angular
- make npm install command to work behind proxy ?
- Node Sass could not find a binding for your current environment
- ngOnDestroy Example Angular
- Angular Component : In which lifecycle hook you can check value of DOM element ?
- @ContentChild TypeError: Cannot read property ‘nativeElement’ of undefined
- Access ng-content with @ContentChild – Angular Component
- How to select an element in a component template – Angular ?
- Difference between @ViewChild and @ContentChild – Angular Example
- Expected 0 type arguments, but got 1 : Angular
- Angular – Access template reference variables from component class ?
- Pass variable from parent to custom child component – Angular 9
- Cannot find name ‘Output’ – Angular
- EventEmitter parameter value undefined for listener
- Typescript Error: Property does not exist on value of type
- Remove http and https proxy settings of npm and git ?
- Fix Nodejs Error: ENOENT: no such file or directory