sandbox-npm-install

Install npm packages on local ext4 filesystem and symlink node_modules into virtiofs-mounted workspaces.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill sandbox-npm-install
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sandbox-npm-install
Source: https://github.com/github/awesome-copilot/tree/main/skills/sandbox-npm-install
Command: npx skills add https://github.com/github/awesome-copilot --skill sandbox-npm-install

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Native Go and Rust binaries like esbuild, lightningcss, and rollup crash with SIGILL, SIGSEGV, or mmap alignment errors when executed from virtiofs-mounted Docker sandbox workspaces, making standard npm installs unusable in containerized development environments.

Core Features & Use Cases

  • Local ext4 Installation: Copies package.json, package-lock.json, and .npmrc to a container-local ext4 directory and runs npm ci or npm install there, avoiding virtiofs crashes.
  • Automatic Symlinking: Symlinks the installed node_modules back into the workspace so the project works normally.
  • Native Binary Verification: Verifies esbuild, rollup, lightningcss, and vite load correctly after installation, with optional Playwright Chromium browser setup.
  • Use Case: You open a fresh Docker sandbox session for a Vite-based web project and the dev server crashes with SIGSEGV. Run the bundled install script to reinstall dependencies on ext4, symlink them back, and verify the toolchain before running npm run dev.

Quick Start

Ask the agent to run the sandbox npm install script from the workspace root to install dependencies and fix native binary crashes.

Frequently Asked Questions about sandbox-npm-install

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install npm packages in a Docker sandbox without crashes?

Run the bundled install script with bash scripts/install.sh from the workspace root. It copies package.json and package-lock.json to a local ext4 directory, runs npm ci there, and symlinks node_modules back into the workspace.

Why do esbuild and rollup crash with SIGSEGV in Docker containers?

Native Go and Rust binaries crash with mmap alignment failures when executed from virtiofs-mounted filesystems on aarch64. Installing on the container's local ext4 filesystem and symlinking node_modules back avoids the issue.

Can I install Playwright browsers with the sandbox install script?

Yes, pass the --playwright flag to the install script. It runs npx playwright install chromium and installs system dependencies using root or passwordless sudo when available.

Does the symlinked node_modules work with Vite dev server?

Yes, but you may need to add the symlink target's parent directory to server.fs.allow in your Vite config so Vite can serve files through the symlink.

What happens if I run npm install directly in the mounted workspace?

Native binaries installed directly on virtiofs will crash with SIGILL or SIGSEGV errors. Always re-run the install script after package.json or package-lock.json changes instead of running npm install in the workspace.