package.json dependencies and Playwright configuration.
Runtime Environment: Playwright Check Suites run in a Node.js runtime containing your custom dependencies. See the runtime specification for further details.
Using JavaScript/Node.js dependencies
Checkly installs dependencies from yourpackage.json and lock files. It works with npm, yarn, and pnpm.
By default, Checkly installs all dependencies (both dependencies and devDependencies). You can change this setting to install only devDependencies in your account settings.
package.json
| Available lock file | Package manager |
|---|---|
package-lock.json | npm |
pnpm-lock.json | pnpm |
yarn.lock | yarn |
installCommand property in your checkly.config.ts:
checkly.config.ts
Using private dependencies
Checkly supports private packages. To authenticate with your private registry, configure your credentials in Checkly.package.json
- Add authentication configuration to your
.npmrcfile - Include the
.npmrcfile in yourcheckly.config.ts - 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
Add your.npmrc file to the checks.include property in your checkly.config.ts.
When you run npx checkly test or npx checkly deploy, the CLI bundles and uploads these files. This makes them available when Checkly runs installCommand to install your dependencies.
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 your lock files (package-lock.json, pnpm-lock.yaml, or yarn.lock) change.
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 if your lock file has changed
- If unchanged, Checkly uses the cached packages, skipping the installation step
- If changed, Checkly installs packages again and updates the cache
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.
Troubleshooting
Package not found
If you see errors like404 Not Found or Package '@your-org/package' not found:
- Verify your
.npmrcfile is included inchecks.include - 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, orpnpm-lock.json) - 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
- Consider using a custom
installCommandto install only required packages