sandbox-npm-install
하는 일
이 도구는 격리된 환경(샌드박스) 안에 Node.js 패키지('npm 패키지')를 설치합니다. 특정 아키텍처(ARM)용으로 컴파일된 프로그램이 특정 방식(virtiofs)으로 파일에 접근할 때 제대로 작동하지 않는 흔한 문제를 해결합니다. 패키지를 안전한 위치에 설치하고 프로젝트와 '연결'해서 제대로 작동하게 합니다.
사용하는 경우
- ✓새 Node.js 프로젝트를 시작해서 처음으로 의존성을 내려받아야 할 때.
- ✓필요한 패키지 목록(package.json 파일)을 바꿔서 설치를 업데이트해야 할 때.
- ✓프로젝트를 실행하거나 빌드할 때 이상한 오류가 나타나고, 특히 '네이티브 바이너리' 관련 문제일 때.
스킬 링크
https://github.com/github/awesome-copilot/blob/main/skills/sandbox-npm-install/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“샌드박스에 제 Node.js 프로젝트의 패키지를 설치해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
도구는 프로젝트의 설정 파일을 격리된 환경 안의 안전한 영역으로 복사합니다. 그곳에서 설치 명령(npm ci)을 실행합니다. 마지막으로 바로가기(심볼릭 링크)를 만들어 프로젝트가 설치된 패키지에 안전하게 접근하도록 합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Sandbox npm Install
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.jsonorpackage-lock.jsonhas changed and you need to reinstall- You encounter native binary crashes with errors like
SIGILL,SIGSEGV,mmap, orunaligned sysNoHugePageOS - The
node_modulesdirectory is missing or corrupted
Prerequisites
- A Docker sandbox environment with a virtiofs-mounted workspace
- Node.js and npm available in the container
- A
package.jsonfile in the target workspace
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.
Step-by-Step Installation
Run the bundled install script from the workspace root:
bash scripts/install.sh
Common Options
| Option | Description |
|---|---|
--workspace <path> |
Path to directory containing package.json (auto-detected if omitted) |
--playwright |
Also install Playwright Chromium browser for E2E testing |
What the Script Does
- Copies
package.json,package-lock.json, and.npmrc(if present) to a local ext4 directory - Runs
npm ci(ornpm installif no lockfile) on the local filesystem - Symlinks
node_modulesback into the workspace - Verifies known native binaries (esbuild, rollup, lightningcss, vite) if present
- Optionally installs Playwright browsers and system dependencies (uses
sudowhen available)
If verification fails, run the script again — crashes can be intermittent during initial setup.
Post-Install Verification
After the script completes, verify your toolchain works. For example:
npm test # Run project tests
npm run build # Build the project
npm run dev # Start dev server
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_modulessymlink appears as a broken link on the host — this is harmless sincenode_modulesis typically gitignored - Running
npm ciornpm installon the host naturally replaces the symlink with a real directory - After any
package.jsonorpackage-lock.jsonchange, re-run the install script - Do NOT run
npm ciornpm installdirectly in the mounted workspace — native binaries will crash
Troubleshooting
| Problem | Solution |
|---|---|
SIGILL or SIGSEGV when running dev server |
Re-run the install script; ensure you're not running npm install directly in the workspace |
node_modules not found after install |
Check that the symlink exists: ls -la node_modules |
| Permission errors during install | Ensure the local deps directory is writable by the current user |
| Verification fails intermittently | Run the script again — native binary crashes can be non-deterministic on first load |
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.
자주 묻는 질문
왜 그냥 `npm install`을 쓰면 안 되나요?
'virtiofs'라는 기술을 쓰는 일부 격리 환경(샌드박스)에서는 esbuild, lightningcss처럼 네이티브로 컴파일된 프로그램이 실패할 수 있습니다. 이 도구는 샌드박스 안의 다른 안전한 위치에 패키지를 설치해 문제를 피합니다.
설치된 패키지는 어떻게 되나요?
패키지는 컴퓨터의 주 저장 공간과 동기화되지 않는 샌드박스 안의 디렉터리에 설치됩니다. 프로젝트는 바로가기를 통해 패키지에 접근하지만, 실제 디렉터리는 격리된 상태로 남습니다.
도구를 실행한 뒤 해야 할 일이 있나요?
네, 설치 후에는 테스트(npm test), 빌드(npm run build), 개발 서버 실행(npm run dev)을 해 보며 프로젝트가 제대로 작동하는지 확인해야 합니다.
상세 정보
작성자의 원본 설명
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 the workspace is mounted via virtiofs. Native binaries (esbuild, lightningcss, rollup) crash on virtiofs, so packages must be installed on the local ext4 filesystem and symlinked back.
repo: github/awesome-copilot
인기도
- GitHub 스타
- 40k
- 순위
- #7415
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
acquire-codebase-knowledge
40k에이전트가 기존 코드 프로젝트를 이해하고 문서화하도록 돕습니다. 새 구성원을 맞이하거나 아키텍처를 개괄적으로 파악할 때 유용합니다.
acreadiness-assess
40k에이전트가 프로젝트의 AI 준비 상태를 평가하고 보고서를 만들도록 합니다. 프로젝트가 AI 도구를 쓸 준비가 얼마나 되어 있는지 이해하는 데 유용합니다.
acreadiness-generate-instructions
40k에이전트가 평가 결과를 바탕으로 AI 도구를 위한 지침을 만들도록 돕습니다. AI가 코드와 상호작용하는 방식을 개선하고 확인된 공백을 메울 때 유용합니다.
acreadiness-policy
40k에이전트가 AI 프로젝트 평가를 위한 정책을 정의하거나 적용하도록 돕습니다. 프로젝트 평가 방식을 표준화하고 규정 준수를 보장할 때 유용합니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.