sandbox-npm-install
यह क्या करती है
यह टूल एक अलग-थलग वातावरण (sandbox) के अंदर Node.js पैकेज (जिन्हें 'npm packages' कहते हैं) इंस्टॉल करता है। यह एक आम समस्या हल करता है जिसमें किसी खास मशीन (जैसे ARM आर्किटेक्चर) के लिए compile किए गए प्रोग्राम तब सही काम नहीं करते जब फ़ाइलों को एक खास तरीके (virtiofs) से एक्सेस किया जाता है। यह टूल पैकेज को एक सुरक्षित जगह पर इंस्टॉल करता है और उन्हें आपके प्रोजेक्ट से 'link' कर देता है ताकि वे काम करें।
कब इस्तेमाल करें
- ✓नया Node.js प्रोजेक्ट शुरू करते समय, जब पहली बार डिपेंडेंसी डाउनलोड करनी हों।
- ✓अगर आपने ज़रूरी पैकेज की सूची (package.json फ़ाइल) बदली है और इंस्टॉलेशन अपडेट करना है।
- ✓अगर आपके प्रोजेक्ट को चलाने या बिल्ड करने में अजीब एरर आएँ, खासकर 'native binaries' से जुड़े।
Skill का लिंक
https://github.com/github/awesome-copilot/blob/main/skills/sandbox-npm-install/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे Node.js प्रोजेक्ट के पैकेज sandbox में इंस्टॉल करो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
टूल आपके प्रोजेक्ट की कॉन्फ़िगरेशन फ़ाइलें sandbox के एक सुरक्षित हिस्से में कॉपी करता है। वहाँ वह इंस्टॉलेशन कमांड (npm ci) चलाता है। अंत में एक शॉर्टकट (symlink) बनाता है ताकि आपका प्रोजेक्ट इन इंस्टॉल किए गए पैकेज को सुरक्षित रूप से एक्सेस कर सके।
तकनीकी सामग्री (मूल 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` क्यों नहीं चला सकता?
कुछ sandbox वातावरण में 'virtiofs' नाम की तकनीक के कारण सीधे compile होने वाले प्रोग्राम (जैसे esbuild, lightningcss) फ़ेल हो सकते हैं। यह टूल sandbox के अंदर एक अलग सुरक्षित जगह पर इंस्टॉल करके इस समस्या को टाल देता है।
इंस्टॉल किए गए पैकेज का क्या होता है?
पैकेज sandbox के एक फ़ोल्डर में इंस्टॉल होते हैं, जो आपके मुख्य कंप्यूटर से सिंक नहीं होता। आपका प्रोजेक्ट शॉर्टकट के ज़रिए इन पैकेज को एक्सेस करता है, लेकिन असली फ़ोल्डर अलग-थलग ही रहता है।
टूल चलाने के बाद क्या मुझे कुछ करना होगा?
हाँ, इंस्टॉलेशन के बाद आपको जाँचना चाहिए कि प्रोजेक्ट उम्मीद के अनुसार काम करता है या नहीं। इसके लिए टेस्ट (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
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
acquire-codebase-knowledge
40kआपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।
acreadiness-assess
40kआपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।
acreadiness-generate-instructions
40kआपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।
acreadiness-policy
40kआपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।