Skip to content

chill-viking/npm-ci

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

The NPM Dependency Installer

MegaLinter

chill-viking/npm-ci

This GitHub action will install npm dependencies, using cache if already cached. The cache is based on packages found in package-lock.json files in source, which are stored as packages-only-lock.json over the course of the action.

Will log a warning if node_modules folder is not found after installing the dependencies.

Usage

steps:
  - uses: chill-viking/npm-ci@latest
    name: Install dependencies
    with:
      working_directory: './npm-root-folder/'

The latest tag will be used for the latest release created, but specific version tags will be created if you need to use a specific version up to the minor version. See releases for details on releases, or tags to view other tags that are available.

Make sure to check out the repository before using this action.

steps:
  - uses: actions/checkout@v3
    name: Checkout repository

  - uses: chill-viking/npm-ci@latest
    name: Install dependencies

Inputs

Name Description Required Default
working_directory The directory to install dependencies in (location of package-lock.json). No ./

Outputs

Name Description
restored_from_cache true if the dependencies were restored from cache, false otherwise.

Compatibility

The following combinations of runner and Node.js version(s) are checked in the workflow Test chill-viking/npm-ci

Runner Node.js
ubuntu-latest 14.x, 16.x, 18.x
windows-latest 18.x
macos-latest 18.x