Jonathan Andersson Jonathan Andersson - 1 month ago 11
Node.js Question

Is it possible to have more then one version of NPM installed without NVM?

Is it possible to have multiple versions of NPM installed without NVM? If it is, is there any command to view them like the command.


npm --version


I guess it's possible to have one version NPM for global and a other version for local projects?

As alex mentioned in the comments, NVM is a alternative to make this possible but is it possible without it?

qzb qzb
Answer

Yes, it is possible. Just install it locally:

$ mkdir -p npm2/node_modules
$ cd npm2
$ npm install npm@2

Now use your local npm instead global one:

$ npm --version
3.10.3
$ ./node_modules/npm/cli.js --version
2.15.11