Node.js with npm
Start with the first-run guide. The example assumes an existing
repository and lockfile. Replace owner/repo with the project ID from your
dashboard, and use your repository's test command.
Configure dependencies and tests
version: 1
project_id: owner/repo
image: ubuntu-24.04-ci
network:
mode: none
warm_mode: allowlist
warm_allowlist: [registry.npmjs.org]
cache:
key_files: [package-lock.json]
checks:
dependencies:
command: npm ci
test:
prepare: npm ci --offline
command: npm test
The check must be named dependencies for Ready CI to run it automatically
before the selected test. Keep preparation enabled: an empty or evicted cache
needs these downloads before the offline test can run. Preparation uses
network.warm_mode and network.warm_allowlist; the test keeps network.mode: none.
The runner sets NPM_CONFIG_CACHE=/cache/npm. This built-in cache already lives
on the persistent cache disk; do not add /cache paths to cache.paths.
Use cache.paths only for additional directories outside /cache.
Each test has a fresh workspace, so cached npm downloads must still be installed
into node_modules. A package with an install script that downloads from another
host needs that host explicitly allowed during preparation; review the script
and configure the check accordingly. Private dependencies also need an explicit
secret-enabled workflow; automatic preparation never receives project secrets.
Preview and run
readyci config validate
readyci check --dry-run --why --json test
readyci check test
Review the dry run's dependency preparation and allowed network hosts.
A successful test reports checks_passed and exits with code 0. Add
affected rules when different
changed paths should select different checks.
Check the remote environment
Your local operating system and installed tools are not copied into the runner.
This example uses ubuntu-24.04-ci. Run readyci doctor --check test --json
to inspect worker compatibility and check the installed tool versions:
readyci run "node --version && npm --version"
Compare those versions with your repository's requirements. A custom run
command does not prepare dependencies automatically. Declare installation
commands and permitted hosts explicitly if you need a different toolchain.
For failures, use dependency troubleshooting.