Registry / devops / nx-gcp-cache

nx-gcp-cache

JSON →
library1.1.2jsnpmunverified

Nx task runner plugin that uses Google Cloud Storage (GCS) as a distributed computational cache for Nx monorepos. Current version 1.1.2, maintained with monthly releases. Supports application default credentials (ADC) for authentication and environment variable overrides. Designed as an alternative to Nx's default cloud cache, providing self-hosted GCS-based caching with minimal configuration through an init schematic.

npm install nx-gcp-cache
INSTALL
IMPORT
SIG · NX-GCP-CACHE
N
nx-gcp-cache
devopsjavascriptv1.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tasksRunnerOptions
Configure in nx.json: "tasksRunnerOptions": { "default": { "runner": "nx-gcp-cache", "options": { "gcpBucket": "my-bucket" } } }
import { tasksRunnerOptions } from 'nx-gcp-cache'
The plugin is configured via nx.json, not imported as a module.

Install plugin, run init schematic, configure bucket, set authentication, and use Nx as usual.

npm install nx-gcp-cache npx nx generate nx-gcp-cache:init # Edit nx.json to set bucket: # "tasksRunnerOptions": { # "default": { # "runner": "nx-gcp-cache", # "options": { # "gcpBucket": "my-bucket/cache" # } # } # } # Set environment variable if needed: export NXCACHE_GCP_BUCKET=my-bucket export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json # Run Nx tasks:npx nx build myapp
Debug
Known issues
gotchaEnvironment variables take precedence over nx.json options. If both are set, the environment variable will be used.
fix
Use only one method of configuration (either nx.json or env vars) to avoid confusion.
affects: >=1.0.0
gotchaOnly ADC authentication is supported. Service account key files must be set via GOOGLE_APPLICATION_CREDENTIALS environment variable or gcloud auth application-default login.
fix
Ensure proper ADC setup: set GOOGLE_APPLICATION_CREDENTIALS or run gcloud auth application-default login
affects: >=1.0.0
gotchaThe init schematic modifies nx.json. Running it multiple times may duplicate entries or break configuration.
fix
Review nx.json after running init. If already configured, skip the init step.
affects: >=1.0.0
deprecatedThis plugin only supports Nx 16+. Older Nx versions are not compatible.
fix
Upgrade Nx to version 16 or later.
affects: <16.0.0
Errors
Common errors & fixes
Error: Timed out while fetching cache from GCS bucket
Slow network or incorrect bucket permissions
fix
Check network connectivity and ensure the service account has storage.objects.get and storage.objects.create permissions on the bucket.
Error: The caller does not have permission
ADC not configured correctly or missing IAM roles
fix
Set GOOGLE_APPLICATION_CREDENTIALS to a valid service account key with Storage Object Admin role.
Error: Cannot find module 'nx-gcp-cache'
Package not installed or installed in wrong directory
fix
Run `npm install nx-gcp-cache` in the workspace root.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
@nx/devkitrequiredRequired to extend Nx task runner configuration
@nx/workspacerequiredRequired for workspace utilities
nxrequiredCore Nx framework peer dependency
Agent activity
2 hits · last 30 days
node
2
Resources
nx-gcp-cache — npm install nx-gcp-cache · libregistry