Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Environment:Getgauge Taiko Node Runtime

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Runtime
Last Updated 2026-02-12 03:00 GMT

Overview

Node.js 20+ runtime environment with npm for running Taiko browser automation scripts and tests.

Description

Taiko is a Node.js library (v1.4.7) for automating Chromium-based browsers. It requires a modern Node.js runtime. While no explicit engines field is declared in package.json, the CI pipeline exclusively tests on Node.js 20, making it the recommended and validated version. The package uses ES module dynamic imports (e.g., in documentation.js) and modern Node.js built-in modules (prefixed with node:), which require Node.js 16+.

Usage

Use this environment for all Taiko operations: running automation scripts via the CLI, using the interactive REPL, executing test suites with Gauge/Mocha/Jest, and developing Taiko plugins. This is the fundamental prerequisite for every Taiko workflow.

System Requirements

Category Requirement Notes
Runtime Node.js 20+ CI-validated version; no explicit engines field in package.json
Package Manager npm (bundled with Node.js) Uses npm ci in CI; npm install for development
Disk ~200MB for node_modules Plus ~150MB for bundled Chromium

Dependencies

Core Dependencies

  • `@babel/parser` >= 7.20.7 (AST parsing for code generation)
  • `chrome-remote-interface` >= 0.33.0 (Chrome DevTools Protocol client)
  • `commander` >= 9.5.0 (CLI argument parsing)
  • `debug` >= 4.3.4 (Namespaced debug logging)
  • `devtools-protocol` = 0.0.1082910 (CDP type definitions, pinned version)
  • `documentation` >= 14.0.1 (API documentation generation)
  • `extract-zip` >= 2.0.1 (Chromium zip extraction)
  • `fs-extra` >= 11.1.0 (Enhanced file system operations)
  • `https-proxy-agent` >= 5.0.1 (HTTP proxy support for Chromium download)
  • `is-reachable` >= 5.2.1 (Network reachability check for reconnection)
  • `progress` >= 2.0.3 (Download progress bar)
  • `proxy-from-env` >= 1.1.0 (Proxy configuration from environment)
  • `recast` >= 0.23.1 (AST-based code transformation)

Development Dependencies

  • `mocha` >= 10.4.0 (Test runner)
  • `chai` >= 4.3.7 (Assertion library)
  • `sinon` >= 15.0.1 (Stubs and mocks)
  • `rewire` >= 6.0.0 (Module testing utility)
  • `typescript` >= 4.9.4 (Type checking)
  • `@biomejs/biome` >= 1.8.3 (Linting and formatting)
  • `husky` >= 8.0.3 (Git hooks)

Credentials

No API keys or tokens are required for core Taiko functionality. All environment variables are optional configuration overrides:

  • `TAIKO_BROWSER_PATH`: Path to custom browser executable (optional)
  • `TAIKO_BROWSER_ARGS`: Additional browser launch arguments (optional)
  • `TAIKO_SKIP_CHROMIUM_DOWNLOAD`: Set to skip bundled Chromium download (optional)
  • `TAIKO_PLUGIN`: Comma-separated plugin names to auto-load (optional)

Quick Install

# Install Taiko (automatically downloads bundled Chromium)
npm install taiko

# Skip Chromium download if using system Chrome
TAIKO_SKIP_CHROMIUM_DOWNLOAD=true npm install taiko

# Verify installation
npx taiko --version

Code Evidence

Environment variable handling from `lib/config.js:1-5`:

const defaultConfig = {
  navigationTimeout: Number(process.env.TAIKO_NAVIGATION_TIMEOUT) || 30000,
  observeTime: 3000,
  retryInterval: 100,
  retryTimeout: Number(process.env.TAIKO_RETRY_TIMEOUT) || 10000,

Chromium skip logic from `lib/install.js:82-96`:

if (
  process.env.TAIKO_SKIP_CHROMIUM_DOWNLOAD &&
  process.env.TAIKO_SKIP_CHROMIUM_DOWNLOAD.toLowerCase() !== "false"
) {
  console.log("Skipping Chromium Download as given in environment variable.");
  return;
}
if (
  process.env.NPM_CONFIG_TAIKO_SKIP_CHROMIUM_DOWNLOAD ||
  process.env.npm_config_taiko_skip_chromium_download
) {
  console.log("Skipping Chromium Download as given in npm config.");
  return;
}

CI workflow from `.github/workflows/taiko.yml:17,57`:

node_version: ['20']
os: [ubuntu-22.04, windows-latest]

Common Errors

Error Message Cause Solution
`Invalid value for X. Expected number received string` Config type mismatch in setConfig() Ensure config values match expected types (number, boolean, string)
`Invalid config X. Allowed configs are ...` Unknown config key passed to setConfig() Check `getConfig()` for the list of valid config keys
`EACCES: permission denied` during install Insufficient permissions for Chromium download Use `npm install --unsafe-perm` or fix directory permissions

Compatibility Notes

  • Node.js 20 is the only CI-tested version. Node.js 16 is used only in the legacy release workflow.
  • Windows: Fully supported. CI tests run on `windows-latest`.
  • macOS: Supported for both Apple Silicon (arm64) and Intel (x64) architectures.
  • Linux: Requires additional system libraries (see Environment:Getgauge_Taiko_Linux_System_Libraries).
  • npm vs yarn: Only npm is tested in CI. Yarn may work but is not validated.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment