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, user=None, silent=True)¶Bootstraps a node.js application.
Will execute 'npm install --json' on the specified directory.
The user to run NPM with
0.17.0 新版功能.
salt.states.npm.
cache_cleaned
(name=None, user=None)¶Ensure that the given package is not cached.
If no package is specified, this ensures the entire cache is cleared.
salt.states.npm.
installed
(name, pkgs=None, dir=None, user=None, force_reinstall=False, registry=None, env=None)¶Verify that the given package is installed and is at the correct version (if specified).
coffee-script:
npm.installed:
- user: someuser
coffee-script@1.0.1:
npm.installed: []
The package to install
在 2014.7.2 版更改: This parameter is no longer lowercased by salt so that case-sensitive NPM package names will work.
A list of packages to install with a single npm invocation; specifying
this argument will ignore the name
argument
2014.7.0 新版功能.
The user to run NPM with
0.17.0 新版功能.
The NPM registry from which to install the package
2014.7.0 新版功能.
A list of environment variables to be set prior to execution. The
format is the same as the cmd.run
.
state function.
2014.7.0 新版功能.
salt.states.npm.
removed
(name, dir=None, user=None)¶Verify that the given package is not installed.
The user to run NPM with
0.17.0 新版功能.