View Source Medic.Checks.NPM (Medic v1.9.0)

Checks that NPM exists, implicitly checking for NodeJS.

examples

Examples

{Check.NPM, :exists?}
{Check.NPM, :require_minimum_version, ["7.8.0"]}
{Check.NPM, :installed?}

Link to this section Summary

Functions

Checks that the packages declared in assets/package-lock.json are all installed.

Checks that npm install has been run at least once.

Checks that there is an npm executable installed locally.

Checks the installed version of npm is greater than or equal to the declared version.

Link to this section Functions

Link to this function

all_packages_installed?(opts \\ [])

View Source
@spec all_packages_installed?(opts :: Keyword.t()) :: Medic.Check.check_return_t()

Checks that the packages declared in assets/package-lock.json are all installed.

Opts:

  • cd: The directory to run the command in.
  • prefix: Run npm with --prefix. Defaults to assets.
Link to this function

any_packages_installed?(opts \\ [])

View Source
@spec any_packages_installed?(opts :: Keyword.t()) :: Medic.Check.check_return_t()

Checks that npm install has been run at least once.

Opts:

  • cd: The directory to run the command in.
  • prefix: Run npm with --prefix. Defaults to assets.
@spec exists?() :: Medic.Check.check_return_t()

Checks that there is an npm executable installed locally.

Link to this function

require_minimum_version(minimum)

View Source
@spec require_minimum_version(binary()) :: Medic.Check.check_return_t()

Checks the installed version of npm is greater than or equal to the declared version.