sandbox-npm-install by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill sandbox-npm-install在以下情况时使用此技能:
package.json 或 package-lock.json 已更改,您需要重新安装SIGILL、SIGSEGV、mmap 或 unaligned sysNoHugePageOS 等错误node_modules 目录缺失或损坏package.json 文件广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Docker 沙盒工作区通常通过 virtiofs(主机与 Linux 虚拟机之间的文件同步)挂载。在 aarch64 架构上,从 virtiofs 执行原生 Go 和 Rust 二进制文件(如 esbuild、lightningcss、rollup 等)时,会因 mmap 对齐失败而崩溃。解决方案是在容器的本地 ext4 文件系统上安装,然后创建符号链接回工作区。
从工作区根目录运行捆绑的安装脚本:
bash scripts/install.sh
| 选项 | 描述 |
|---|---|
--workspace <路径> | 包含 package.json 的目录路径(如果省略则自动检测) |
--playwright | 同时安装用于端到端测试的 Playwright Chromium 浏览器 |
package.json、package-lock.json 和 .npmrc(如果存在)复制到本地 ext4 目录npm ci(如果没有 lockfile 则运行 npm install)node_modules 符号链接回工作区sudo)如果验证失败,请再次运行脚本——在初始设置期间,崩溃可能是间歇性的。
脚本完成后,请验证您的工具链是否正常工作。例如:
npm test # 运行项目测试
npm run build # 构建项目
npm run dev # 启动开发服务器
/home/agent/project-deps)是容器本地的,不会同步回主机node_modules 符号链接显示为损坏的链接——这通常无害,因为 node_modules 通常被 git 忽略npm ci 或 npm install 会自然地用真实目录替换符号链接package.json 或 package-lock.json 更改后,请重新运行安装脚本npm ci 或 npm install——原生二进制文件将会崩溃| 问题 | 解决方案 |
|---|---|
运行开发服务器时出现 SIGILL 或 SIGSEGV | 重新运行安装脚本;确保您没有在工作区中直接运行 npm install |
安装后找不到 node_modules | 检查符号链接是否存在:ls -la node_modules |
| 安装期间出现权限错误 | 确保当前用户对本地依赖目录具有写权限 |
| 验证间歇性失败 | 再次运行脚本——原生二进制文件在首次加载时的崩溃可能是非确定性的 |
如果您的项目使用 Vite,您可能需要在 server.fs.allow 中允许符号链接路径。将符号链接目标的父目录(例如 /home/agent/project-deps/)添加到您的 Vite 配置中,以便 Vite 可以通过符号链接提供文件。
每周安装次数
311
代码仓库
GitHub 星标数
26.7K
首次出现
8 天前
安全审计
已安装于
gemini-cli282
codex280
opencode272
cursor270
github-copilot269
cline268
Use this skill whenever:
package.json or package-lock.json has changed and you need to reinstallSIGILL, SIGSEGV, mmap, or unaligned sysNoHugePageOSnode_modules directory is missing or corruptedpackage.json file in the target workspaceDocker 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.
Run the bundled install script from the workspace root:
bash scripts/install.sh
| Option | Description |
|---|---|
--workspace <path> | Path to directory containing package.json (auto-detected if omitted) |
--playwright | Also install Playwright Chromium browser for E2E testing |
package.json, package-lock.json, and .npmrc (if present) to a local ext4 directorynpm ci (or npm install if no lockfile) on the local filesystemnode_modules back into the workspacesudo when available)If verification fails, run the script again — crashes can be intermittent during initial setup.
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
/home/agent/project-deps) is container-local and is NOT synced back to the hostnode_modules symlink appears as a broken link on the host — this is harmless since node_modules is typically gitignorednpm ci or npm install on the host naturally replaces the symlink with a real directorypackage.json or package-lock.json change, re-run the install scriptnpm ci or npm install directly in the mounted workspace — native binaries will crash| 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 |
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.
Weekly Installs
311
Repository
GitHub Stars
26.7K
First Seen
8 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli282
codex280
opencode272
cursor270
github-copilot269
cline268
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
100,500 周安装
社交媒体内容策略指南:LinkedIn、Twitter、Instagram、TikTok、Facebook平台优化与内容创作模板
303 周安装
data-extractor 数据提取技能:从PDF、Word、Excel等文档自动提取结构化数据
304 周安装
架构决策框架:需求驱动架构设计,ADR记录决策,权衡分析指南
304 周安装
使用reveal.js创建HTML幻灯片 | 交互式演示文稿制作工具 | 代码高亮与动画效果
304 周安装
移动应用发布策略指南:从ASO优化到推广渠道的完整发布计划
304 周安装
计分卡营销系统:四步法生成高转化率潜在客户,互动评估提升线索质量
304 周安装