environmentVariables.NODE_ENV
Pass production, development, or test to set NODE_ENV during npm ci inside the container. Affects lifecycle scripts that branch on this variable.
Prerequisites, token setup, and a complete per-language integration snippet.
Collect these inputs before sending your first request.
package.json and package-lock.json from the project you want to cache.dockerImageReference — use the official node image with a specific version tag (e.g. node:22.15.0) and CPU architecture (x64 or arm64). Avoid floating tags such as node:lts or node:22 — the service pins the cache to the exact image digest, so an undetected image update will silently cause cache misses.curl, jq, and tar available on the runner.NMC_ACCESS_TOKEN.NMC_ACCESS_TOKEN — never commit tokens to source control.Each snippet covers the full flow: read the manifest files, call the API, save and extract the archive, and fall back to npm ci if the request fails or returns an error.
# Download the binary for your platform.
# All releases: https://www.node-modules-cache.com/nmc-cli
# Linux amd64
curl -fsSL "https://www.node-modules-cache.com/nmc-cli/nmc-linux-amd64" \
-o nmc && chmod +x nmc
# Linux arm64
# curl -fsSL "https://www.node-modules-cache.com/nmc-cli/nmc-linux-arm64" \
# -o nmc && chmod +x nmc
# Required environment variables
export NMC_TOKEN="${NMC_ACCESS_TOKEN}" # your API token
export NMC_BASE_DIR="/path/to/project" # absolute path — package.json must be here
export NMC_DOCKER_IMAGE="node:22.15.0" # your CI Docker image reference
export NMC_ARCHITECTURE="x64" # x64 or arm64
# Run — reads manifests, calls the API, extracts node_modules,
# retries up to 5 times, and falls back automatically on error.
./nmc
The nmc CLI is an open-source Go binary maintained by us. Download binaries for Linux and Windows (amd64 / arm64) from the nmc CLI page .
All fields below are optional. Omit them if you do not need them.
environmentVariables.NODE_ENVPass production, development, or test to set NODE_ENV during npm ci inside the container. Affects lifecycle scripts that branch on this variable.
dockerImageReference, architecture, package.json, and package-lock.json in an application/json body. Optional: environmentVariables (see step 4).node_modules.tar.gz artifact — extract before running tasks that depend on node_modules/.