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

Checks that NPM exists, implicitly checking for NodeJS.

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

Specs

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

Specs

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.

Specs

Checks that there is an npm executable installed locally.

Link to this function

require_minimum_version(minimum)

View Source

Specs

require_minimum_version(binary()) :: Medic.Check.check_return_t()

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