Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install certain node version from command line

Tags:

node.js

npm

I want to install node 6.9.4.

In windows console I try with this:

npm install [email protected]

And it throws this error:

npm ERR! No compatible version found: [email protected]
npm ERR! Valid install targets:
npm ERR! 0.0.0

In linux the result is similar. I try with

sudo npm install [email protected]

and the output is:

npm ERR! version not found: [email protected]

Is there a way to install certain node version with npm?

like image 348
Fernando Avatar asked Jul 07 '17 11:07

Fernando


People also ask

How do I install a specific version of node?

How To Install A Specific Version Of A Package. You can use the npm install command to download and install a package on your development environment. By default, the npm install command fetches the latest available version of the specified package—in this case, it's Renovate version 24.52.

How do I run a specific version of node in Windows?

Wrap up. NVM for Windows allows us to switch between versions of node efficiently. First, we install the node versions we need to work with into NVM using nvm install . We then use nvm use to switch to a specific version of node.


1 Answers

You should use nvm to install and manage node versions and not npm

NPM is the package manager for node and not a version manager.

To install a particular version of node using nvm, just do

nvm install v0.10.32

NPM should be used to install packages/modules. So say you need to use request module for a particular project You can do

npm install request

Both these support tons of options which could be found over the documentations

like image 63
Shivam Avatar answered Sep 29 '22 11:09

Shivam