How to install a specific version of node from the command line

I want to install node 6.9.4.

In the windows console, I try:

npm install node@v6.9.4

And this causes this error:

npm ERR! No compatible version found: node@v6.9.4
npm ERR! Valid install targets:
npm ERR! 0.0.0

On linux, the result is similar. I'm trying with

sudo npm install node@v6.9.4

and output:

npm ERR! version not found: node@6.9.4-cls

Is there a way to install a specific version of node with npm?

+4
source share
3 answers

You should use nvmnode to install and version control, notnpm

NPM is a package manager for node, not a version manager.

To install a specific version of node using nvm just do

nvm install v0.10.32

NPM should be used to install packages / modules. Therefore, say that you need to use the request module for a specific project. You can do

npm install request

,

+7

I recommend you use nvm: Nodev Version Manager

It would be as simple as

nvm install 6.9.4

This is a really good tool for managing all of your node versions.

+1
source

Source: https://habr.com/ru/post/1680957/


All Articles