Skip to content
Browse docs

Install Mockspace

Install and verify the CLI, then prepare capture dependencies in your application.

On this page

Install and verify#

You need Node.js 20.6 or later, npm, a terminal, and access to this service for the first CLI download. Your app keeps its own runtime and package-manager requirements. Browser reviewers can open an authorized review link without installing anything.

node --version
npm install -g https://mockspace.ynext.co/mockspace-cli.tgz
mockspace --help

The service distributes a small launcher. It downloads the deployed CLI into your user cache on first use and when the service version changes. It runs the extracted package without running npm install there. If the service is unavailable, it can use an already cached version; a fresh installation needs network access. The source package is private: the service tarball is the installation address, not a public npm registry package name.

The CLI uses Node; screenshots additionally require a platform supported by your installed Playwright release and its Chromium. Check the Playwright system requirements for your operating system. The shell examples in the agent guide use a POSIX shell; in other shells, read or copy the same files using that shell’s path syntax.

Reach your first local canvas#

Follow the quick start or paste the prompt from Set up with your agent in your app repository. Reuse existing configuration. Local check and dev do not require a hosted-service login. The live viewer uses your running app and does not require Playwright.

Prepare capture explicitly#

A static build needs both an app-local Playwright module and the Chromium revision that module expects. Installing a browser through a temporary npx package alone does not install the module where Mockspace can resolve it.

If your app does not already declare Playwright, run one of these sequences in the app directory containing .mockspace. Choose the package manager already used by the app.

For npm:

npm install --save-dev --save-exact playwright@1.62.1
node node_modules/playwright/cli.js install chromium

For pnpm:

pnpm add -D -E playwright@1.62.1
node node_modules/playwright/cli.js install chromium

On Linux, if Chromium needs system libraries, replace the second command with the following explicit installation; your environment may require administrator privileges for those libraries.

node node_modules/playwright/cli.js install --with-deps chromium

If the app already declares playwright, @playwright/test, or playwright-core, keep its existing version and lockfile. Use that installed package’s cli.js to install chromium; for example, node node_modules/@playwright/test/cli.js install chromium. When multiple packages are exposed, Mockspace resolves playwright first, then @playwright/test, then playwright-core, starting at the app directory and walking its ancestors using Node module resolution. Use the first resolved package’s browser installer. In a pnpm workspace, add the dependency to the app package; a hidden, unrelated entry in .pnpm is not a declared dependency.

Verify that the app-local module and its browser can actually launch. For the playwright installation above:

node --input-type=module -e 'import { chromium } from "playwright"; const browser = await chromium.launch(); console.log(browser.version()); await browser.close();'

Run installation and capture as the same user. If you set PLAYWRIGHT_BROWSERS_PATH, use the same value for the install and build commands. A module install never substitutes for a browser launch test. See Playwright browser installation for browser caches and operating-system dependencies.

Update and recover#

  • Command not found: check that npm’s global bin directory is on your PATH, then open a new terminal and run mockspace --help.
  • Download or health request failed: check access to this service’s /healthz and /mockspace-cli.tgz. Retry once connectivity is restored. A cached fallback message means you are running the cached version.
  • To update the launcher itself, repeat the install command above. The launcher handles deployed CLI updates on subsequent runs.
  • Playwright not found: install it in the app workspace you pass to --project. Installing it globally or only downloading Chromium does not satisfy module resolution.
  • Executable does not exist or browser revision mismatch: rerun the resolved package’s cli.js install chromium, using the same user and browser-cache setting as capture.
  • Browser launch denied: the host must allow Chromium processes. Report the sandbox error and missing permission instead of marking a skipped or failed capture successful.
  • App unavailable or frames blank: start the app with the command printed by mockspace check, confirm its configured URL, and inspect its fixture logs. The CLI does not start the app for you.