npm-git-install
Install npm packages directly from GitHub repositories using git URLs. Use when installing packages from private repos, specific branches, or unreleased versions not yet on npm registry.
What this skill does
# npm install Git Repository Guide Covers how to install npm packages directly from GitHub repositories. Useful for installing packages not in the npm registry, specific branches, or private repositories. ## When to use this skill - **Packages Not on npm**: Install packages not yet published - **Specific Branch/Tag**: Install main, develop, specific release tags - **Private Repositories**: Install packages within an organization - **Forked Packages**: Use a modified fork version - **Test Latest Commits**: Test the latest code before a release --- ## 1. Installation Commands ### Basic Syntax ```bash npm install git+https://github.com/<owner>/<repo>.git#<branch|tag|commit> ``` ### HTTPS Method (Common) ```bash # Specific branch npm install -g git+https://github.com/JEO-tech-ai/supercode.git#main # Specific tag npm install git+https://github.com/owner/repo.git#v1.0.0 # Specific commit npm install git+https://github.com/owner/repo.git#abc1234 # Default branch (omit #) npm install git+https://github.com/owner/repo.git ``` ### SSH Method (With SSH Key Setup) ```bash npm install -g git+ssh://[email protected]:JEO-tech-ai/supercode.git#main ``` ### Verbose Logging ```bash npm install -g git+https://github.com/JEO-tech-ai/supercode.git#main --verbose ``` --- ## 2. npm install Flow What npm performs when installing from a Git URL: ``` 1. Git Clone └─ Clone repository at specified branch (#main) ↓ 2. Install Dependencies └─ Install dependencies in package.json ↓ 3. Run Prepare Script └─ Run "prepare" script (TypeScript compile, build, etc.) ↓ 4. Register Global Binary └─ Link executable from bin field to global path ``` ### Internal Operation ```bash # What npm does internally git clone https://github.com/owner/repo.git /tmp/npm-xxx cd /tmp/npm-xxx git checkout main npm install npm run prepare # Run if exists cp -r . /usr/local/lib/node_modules/repo/ ln -s ../lib/node_modules/repo/bin/cli.js /usr/local/bin/repo ``` --- ## 3. Verify Installation Location ```bash # Check global npm path npm root -g # macOS/Linux: /usr/local/lib/node_modules # Windows: C:\Users\<username>\AppData\Roaming\npm\node_modules # Check installed package npm list -g <package-name> # Check binary location which <command> # or npm bin -g ``` ### Installation Locations by Platform | Platform | Package Location | Binary Location | |----------|-----------------|----------------| | macOS/Linux | `/usr/local/lib/node_modules/` | `/usr/local/bin/` | | Windows | `%AppData%\npm\node_modules\` | `%AppData%\npm\` | | nvm (macOS) | `~/.nvm/versions/node/vX.X.X/lib/node_modules/` | `~/.nvm/versions/node/vX.X.X/bin/` | --- ## 4. Add Dependencies to package.json ### Use Git URL in dependencies ```json { "dependencies": { "supercode": "git+https://github.com/JEO-tech-ai/supercode.git#main", "my-package": "git+ssh://[email protected]:owner/repo.git#v1.0.0", "another-pkg": "github:owner/repo#branch" } } ``` ### Shorthand Syntax ```json { "dependencies": { "pkg1": "github:owner/repo", "pkg2": "github:owner/repo#branch", "pkg3": "github:owner/repo#v1.0.0", "pkg4": "github:owner/repo#commit-sha" } } ``` --- ## 5. Install from Private Repositories ### SSH Key Method (Recommended) ```bash # 1. Generate SSH key ssh-keygen -t ed25519 -C "[email protected]" # 2. Register public key on GitHub cat ~/.ssh/id_ed25519.pub # GitHub → Settings → SSH Keys → New SSH Key # 3. Install via SSH method npm install git+ssh://[email protected]:owner/private-repo.git ``` ### Personal Access Token Method ```bash # 1. Create PAT on GitHub # GitHub → Settings → Developer settings → Personal access tokens # 2. Install with token in URL npm install git+https://<token>@github.com/owner/private-repo.git # 3. Use environment variable (recommended for security) export GITHUB_TOKEN=ghp_xxxxxxxxxxxx npm install git+https://${GITHUB_TOKEN}@github.com/owner/private-repo.git ``` ### .npmrc Configuration ```bash # ~/.npmrc //github.com/:_authToken=${GITHUB_TOKEN} ``` --- ## 6. Common Errors & Solutions ### Permission denied (EACCES) ```bash # Method 1: Change ownership sudo chown -R $(whoami) /usr/local/lib/node_modules # Method 2: Change npm directory (recommended) mkdir ~/.npm-global npm config set prefix '~/.npm-global' echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc source ~/.bashrc ``` ### Git Not Installed ```bash # macOS brew install git # Ubuntu/Debian sudo apt-get install git # Windows # https://git-scm.com/download/win ``` ### GitHub Authentication Error ```bash # Test SSH connection ssh -T [email protected] # Cache credentials git config --global credential.helper store # or macOS git config --global credential.helper osxkeychain ``` ### prepare Script Failure ```bash # For TypeScript projects npm install -g typescript # Verbose log on build failure npm install git+https://... --verbose 2>&1 | tee npm-install.log ``` ### Cache Issues ```bash # Clear npm cache npm cache clean --force # Reinstall npm uninstall -g <package> npm install -g git+https://... ``` --- ## 7. Update & Manage ### Update ```bash # Update to latest version (reinstall) npm uninstall -g <package> npm install -g git+https://github.com/owner/repo.git#main # Update package.json dependency npm update <package> ``` ### Check Version ```bash # Check installed version npm list -g <package> # Check remote latest commit git ls-remote https://github.com/owner/repo.git HEAD ``` ### Remove ```bash npm uninstall -g <package> ``` --- ## 8. Cursor/VS Code Extension Integration Example ### Supercode Installation Example ```bash # Global install npm install -g git+https://github.com/JEO-tech-ai/supercode.git#main # Verify installation supercode --version ``` ### Project Configuration File ```json // .supercoderc or supercode.config.json { "aiRules": { "enabled": true, "techStack": ["TypeScript", "React", "Node.js"] }, "smartActions": [ { "name": "Generate Documentation", "icon": "docs", "prompt": "Generate comprehensive documentation" } ], "architectureMode": { "enabled": true, "detailLevel": "detailed" } } ``` --- ## 9. Best Practices ### DO (Recommended) 1. **Use Specific Version/Tag**: Pin version with `#v1.0.0` format 2. **Prefer SSH Method**: Use SSH key when accessing private repos 3. **Manage Token via Environment Variables**: Store PAT in env vars 4. **Commit Lockfile**: Ensure reproducibility by committing package-lock.json 5. **Use Verbose Option**: Check detailed logs when issues occur ### DON'T (Prohibited) 1. **Hardcode Tokens**: Do not input tokens directly in package.json 2. **Depend on Latest Commit**: Use tags instead of `#main` in production 3. **Abuse sudo**: Resolve permission issues with directory configuration 4. **Ignore Cache**: Clear cache when experiencing unusual behavior --- ## Constraints ### Required Rules (MUST) 1. **Git Must Be Installed**: Verify git is installed before npm git URL install 2. **Network Access**: Environment with access to GitHub required 3. **Node.js Version**: Check engines field in package.json ### Prohibited (MUST NOT) 1. **Expose Auth Tokens**: Do not expose tokens in logs or code 2. **Indiscriminate sudo**: Resolve permission issues with configuration 3. **Use #main in Production**: Pin to specific version/tag --- ## References - [npm-install Official Documentation](https://docs.npmjs.com/cli/v9/commands/npm-install/) - [How To Install NPM Packages Directly From GitHub](https://www.warp.dev/terminus/npm-install-from-github) - [npm install from GitHub - Stack Overflow](https://stackoverflow.com/questions/17509669/how-to-install-an-npm-package-from-github-directly) - [Working with the npm registry - GitHub Docs](https://docs.github.com/packages/working-with-a-github-packages-registry/working-with-the-npm-registry) --- ## Metadata ### Version - **Current Version**: 1.0.0 - **Last Updated**: 2026-01-10 - **
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.