salt.states.npm

Installation of NPM Packages

These states manage the installed packages for node.js using the Node Package Manager (npm). Note that npm must be installed for these states to be available, so npm states should include a requisite to a pkg.installed state for the package which provides npm (simply npm in most cases). Example:

npm:
  pkg.installed

yaml:
  npm.installed:
    - require:
      - pkg: npm
salt.states.npm.bootstrap(name, runas=None)

Bootstraps a node.js application.

will execute npm install --json on the specified directory

runas
The user to run NPM with
salt.states.npm.installed(name, dir=None, runas=None, force_reinstall=False, **kwargs)

Verify that the given package is installed and is at the correct version (if specified).

dir
The target directory in which to install the package, or None for global installation
runas
The user to run NPM with
force_reinstall
Install the package even if it is already installed
salt.states.npm.removed(name, dir=None, runas=None, **kwargs)

Verify that the given package is not installed.

dir
The target directory in which to install the package, or None for global installation
runas
The user to run NPM with

Table Of Contents

Previous topic

salt.states.network

Next topic

salt.states.pecl