Labsco
github logo

sandbox-npm-install

✓ Official36,200

by github · part of github/awesome-copilot

Install npm packages in a Docker sandbox environment. Use this skill whenever you need to install, reinstall, or update node_modules inside a container where…

🔥🔥✓ VerifiedFreeQuick setup
🧩 One of 7 skills in the github/awesome-copilot package — works on its own, and pairs well with its siblings.

Install npm packages in a Docker sandbox environment. Use this skill whenever you need to install, reinstall, or update node_modules inside a container where…

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by github

Install npm packages in a Docker sandbox environment. Use this skill whenever you need to install, reinstall, or update node_modules inside a container where… npx skills add https://github.com/github/awesome-copilot --skill sandbox-npm-install Download ZIPGitHub36.2k

When to Use This Skill

Use this skill whenever:

  • You need to install npm packages for the first time in a new sandbox session

  • package.json or package-lock.json has changed and you need to reinstall

  • You encounter native binary crashes with errors like SIGILL, SIGSEGV, mmap, or unaligned sysNoHugePageOS

  • The node_modules directory is missing or corrupted

Background

Docker sandbox workspaces are typically mounted via virtiofs (file sync between the host and Linux VM). Native Go and Rust binaries (esbuild, lightningcss, rollup, etc.) crash with mmap alignment failures when executed from virtiofs on aarch64. The fix is to install on the container's local ext4 filesystem and symlink back into the workspace.

Important Notes

  • The local install directory (e.g., /home/agent/project-deps) is container-local and is NOT synced back to the host

  • The node_modules symlink appears as a broken link on the host — this is harmless since node_modules is typically gitignored

  • Running npm ci or npm install on the host naturally replaces the symlink with a real directory

  • After any package.json or package-lock.json change, re-run the install script

  • Do NOT run npm ci or npm install directly in the mounted workspace — native binaries will crash

Vite Compatibility

If your project uses Vite, you may need to allow the symlinked path in server.fs.allow. Add the symlink target's parent directory (e.g., /home/agent/project-deps/) to your Vite config so that Vite can serve files through the symlink.