install a package programmatically

npm.commands.install([where,] packages, callback)

This acts much the same ways as installing on the command-line.

The 'where' parameter is optional and only used internally, and it specifies where the packages should be installed to.

The 'packages' parameter is an array of strings. Each element in the array is the name of a package to be installed.

Finally, 'callback' is a function that will be called when all packages have been installed or when an error has been encountered.

Last modified August 20, 2015           Found a typo? Send a pull request!

Getting Started

Private Modules

Using npm

npm Enterprise

CLI Commands

Configuring npm

Using npm programmatically

npm policy documents

View All On One Page