package.json dependencies and Playwright configuration.
Playwright Check Suites do not use Checkly runtimes. Browser Checks and Multistep Checks use
runtimeId to select a managed runtime with fixed Checkly-provided dependencies. Playwright Check Suites install your project dependencies and use engine to select the JavaScript engine version.Using JavaScript/Node.js dependencies
Checkly installs dependencies from yourpackage.json and lock files. It works with npm, yarn, pnpm, and bun.
By default, Checkly installs all dependencies (both dependencies and devDependencies).
package.json
Workspace support
Starting from Checkly CLI 7.1., Checkly supportsnpm and pnpm workspaces in Playwright Check Suites, while Yarn workspaces remain unsupported.
If your Playwright tests are stored in a monorepo, Checkly automatically recognizes and manages dependencies based on your workspace configuration.
When using workspaces, packages in your workspace can depend on other packages in the same workspace, including those from the root package. See the pnpm workspaces docs or npm workspaces docs to learn how workspaces work.
Requirements:
- Place your lock file (
package-lock.jsonorpnpm-lock.yaml) at the workspace root - Include both root and workspace
package.jsonfiles in your project
exports and imports features in package.json.
No additional configuration is needed in checkly.config.ts for workspace support.
Private packages
How you use private packages depends on whether Checkly can reach the registry that serves them:package.json
- Add authentication configuration to your
.npmrcfile - Store authentication tokens as environment variables in Checkly
Configure authentication to private dependencies
All package managers (npm, yarn, pnpm) use.npmrc files to authenticate with private registries.
Store authentication tokens as Checkly environment variables. Reference them in your
.npmrc file using ${VARIABLE_NAME} syntax.Using private npm packages
Using JFrog Artifactory
Using GitHub Packages
Using yarn or pnpm with private packages
yarn and pnpm also use.npmrc for authentication (same format as npm examples above).
Include authentication files
When you runnpx checkly test or npx checkly deploy, the CLI bundles and uploads your .npmrc files automatically: the one at the workspace root and any next to a workspace member’s package.json. This makes them available when Checkly runs installCommand to install your dependencies.
Using lifecycle scripts
Some npm packages define lifecycle scripts (such asprepare, postinstall, or preinstall) that run during installation and may require access to files not automatically included in the CLI’s code bundle.
If you’re confident your dependencies work without lifecycle scripts, you can use the installCommand property to pass the --ignore-scripts flag to your package manager:
checkly.config.ts
include option to add any required files to the code bundle:
checkly.config.ts
Dependency Caching
Checkly caches installed packages between check runs to speed up execution and reduce installation time. Dependencies are installed once and reused for subsequent runs until the files that define your dependencies change, such as your lock file and yourpackage.json and .npmrc files, or until your installCommand, your working directory, or your engine change. Changes to embedded or pruned packages and registry routing also invalidate the cache.
How caching works
When dependency caching is enabled:- On the first run, Checkly installs all packages from your lock file and stores them in cache
- On subsequent runs, Checkly checks whether any of the inputs described above have changed
- If unchanged, Checkly uses the cached packages, skipping the installation step
- If changed, Checkly installs packages again and updates the cache
Force a reinstall
To make Checkly reinstall dependencies without changing any of these files, setrunner.cache.install.version at the top level of your checkly.config.ts and change its value whenever you want a fresh install. Deployed checks pick up the new value on the next npx checkly deploy.
checkly.config.ts
version: process.env.DEPENDENCY_CACHE_VERSION, is safe when the variable isn’t set.
For a one-off fresh install, pass --refresh-cache to checkly test, checkly pw-test, checkly trigger, or checkly checks run instead.
Automatic retries
Checkly automatically retries transient failures during setup steps. Cache downloads retry up to 3 times with exponential backoff. If all attempts fail, the run falls back to a clean install.Dependency Cache behavior by location type
Public Locations: Dependency caching is Always ON. Private Locations: Dependency caching is OFF by default. To enable caching and speed up check runs, setDEPENDENCY_CACHE=CHECKLY_S3 in your agent configuration.
Speed up installs
The runner installs your dependencies whenever the dependency cache can’t be used: on the first run, after your dependencies change, and on every run in Private Locations that don’t have dependency caching turned on. Every package it installs adds to that time, so removing packages your checks never load from the install makes those runs start faster. In a monorepo, lockfile pruning already leaves out the dependencies of workspace members outside the bundle. To go further, remove the development tooling that yourpackage.json declares but your tests don’t need, such as linters, formatters, and component workshops, with bundle.packages.prune:
checkly.config.ts
devDependencies of the bundled package.json files. The CLI then regenerates the bundled lockfile, so everything those tools depend on drops out too, and the runner installs only what remains. Your local package.json is unchanged, so linting and Storybook keep working on your machine.
Pruning works the same way in a single-package project as in a monorepo. Only remove packages that neither your tests nor the install use: keep build tools such as typescript when an install script needs them. The CLI doesn’t check this for you. See Prune manifest dependencies for the full syntax, including entries scoped to one workspace member, and its requirements and caveats.
Playwright browser caching
Checkly caches Playwright browsers so that runs don’t download them every time. How caching works depends on which location your checks run.Browser caching on Public Locations
Checkly caches Playwright browsers across all public regions to reduce startup time. When a new Playwright version is available, runs download browsers until Checkly updates the shared cache.Browser caching on Private Locations
Checkly caches Playwright browsers on each Private Location agent, grouped by Playwright version. When a matching version exists in cache, Checkly skips the download — reducing startup time and making runs more reliable.Browser caching requires Private Location agent v8.2.0 or later.
Troubleshooting Dependency Installation
Package not found
If you see errors like404 Not Found or Package '@your-org/package' not found:
- Verify your
.npmrcfile is at the workspace root or next to thepackage.jsonthat needs it - If the registry is only reachable from your own network, see Internal Registries
- Check that the registry URL is correct
- Ensure your package name matches exactly (including scope)
Authentication failed
If you see401 Unauthorized or 403 Forbidden errors:
- Verify the environment secret is set in Checkly (see environment variables)
- Ensure the variable name in your
.npmrcfile matches exactly (e.g.,${NPM_TOKEN}) - Confirm that your token has the necessary permissions to access the package
Wrong package manager detected
If Checkly uses the wrong package manager:- Verify the correct lock file is present (
package-lock.json,yarn.lock,pnpm-lock.yaml, orbun.lock) - Remove any conflicting lock files
- Override with a custom
installCommandif needed (see customize install commands)
Installation timeout
If package installation exceeds time limits:- Check for large dependencies that can be optimized
- Remove dependencies your checks don’t use from the code bundle with
bundle.packages.prune - Consider using a custom
installCommandto install only required packages
Memory usage exceeded
If you see errors indicating that memory limits were exceeded during installation:- Optimize your dependencies to reduce memory consumption
- Remove dependencies your checks don’t use from the code bundle with
bundle.packages.prune - Consider using a custom
installCommandto install only necessary packages
General installation failures
If you encounter general installation errors:- Review the full error logs for specific issues
- Ensure all dependencies are compatible with the Node.js version used by Checkly
- Consider using a custom
installCommandto handle complex installations