Install multiple versions of a node module to versioned or custom directories.
npm install -g install-npm-version
Syntax:
inv <package> [options...]
install-npm-version <package> [options...]
Required:
package
Package to be installed, which is passed through to "npm install <package>".
Optional:
--destination, --d
Directory path relative to node_modules/ of the [working-directory] to install package to.
Default: sanitized <package>
--overwrite, --o
Overwrite any existing package at [destination] location.
Default: false
--silent, --s
Suppress informational messages, but error messages will still be shown.
Default: false
--debug
Shows detailed messages about execution process.
Default: false
--working-directory, --wd
Directory that contains node_modules/ folder to install package to. If no node_modules/ folder exists, one will be created.
Default: current directory
--useLocalNpmConfig
Uses any existing NPM configuration within [working-directory] when installing package.
--help, --h
Shows these how-to instructions.
> inv [email protected]
# installs [email protected] to node_modules/[email protected]/
> inv [email protected] --destination some/path/chalk
# installs [email protected] to node_modules/some/path/chalk/
npm install install-npm-version --save-dev
import inv = require('install-npm-version');
inv.Install('[email protected]');
// installs [email protected] to node_modules/[email protected]/
inv.Install('[email protected]');
// installs [email protected] to node_modules/[email protected]/
import inv = require('install-npm-version');
inv.Install('[email protected]', { 'Destination': 'some/path/chalk' });
// installs [email protected] to node_modules/some/path/chalk/
import inv = require('install-npm-version');
inv.Install('[email protected]', { 'Verbosity': 'Silent' });
inv.Install('[email protected]', { 'Verbosity': 'Debug' });
import inv = require('install-npm-version');
inv.Install('[email protected]', { 'Destination': 'mydir' });
// installs [email protected] to node_modules/mydir/
inv.Install('[email protected]', { 'Destination': 'mydir' });
// does not install [email protected] since node_modules/mydir/ already exists
inv.Install('[email protected]', { 'Destination': 'mydir', 'Overwrite': true });
// installs [email protected] to node_modules/mydir/ by overwriting existing install