How to manage different versions of packages through npm?

  node.js, question

For example, I want to install jquery of 1.11.1 and jquery of 2.1.1 at the same time

NPM I-Save https://github.com/qiu8310/jquery-legacy.git # NPM inside has a jquery-legacy jq path problem now, so it directly uses another fork's git warehouse
 Npm install jquery@2 # is now installed without version 3 by default.

Then js file inside

require("jsdom").env("", function(err, window) {
 if (err) {
 return console.error(err);
 bracket
 
 var jquery2 = require('jquery')(window);
 console.log(jquery2.fn.jquery);
 var jquery1 = require('jquery-legacy')(window);
 console.log(jquery1.fn.jquery);
 });

Reference: