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.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o npm-git-install.zip https://jpskill.com/download/20910.zip && unzip -o npm-git-install.zip && rm npm-git-install.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/20910.zip -OutFile "$d\npm-git-install.zip"; Expand-Archive "$d\npm-git-install.zip" -DestinationPath $d -Force; ri "$d\npm-git-install.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
npm-git-install.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
npm-git-installフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
npm install Gitリポジトリガイド
GitHubリポジトリから直接npmパッケージをインストールする方法について説明します。npmレジストリにないパッケージ、特定のブランチ、またはプライベートリポジトリをインストールする場合に便利です。
このスキルを使用するタイミング
- npmにないパッケージ: まだ公開されていないパッケージをインストールする場合
- 特定のブランチ/タグ: main、develop、特定のリリースタグをインストールする場合
- プライベートリポジトリ: 組織内のパッケージをインストールする場合
- フォークされたパッケージ: 修正されたフォークバージョンを使用する場合
- 最新コミットのテスト: リリース前に最新のコードをテストする場合
1. インストールコマンド
基本構文
npm install git+https://github.com/<owner>/<repo>.git#<branch|tag|commit>
HTTPSメソッド (一般的)
# 特定のブランチ
npm install -g git+https://github.com/JEO-tech-ai/supercode.git#main
# 特定のタグ
npm install git+https://github.com/owner/repo.git#v1.0.0
# 特定のコミット
npm install git+https://github.com/owner/repo.git#abc1234
# デフォルトブランチ (#を省略)
npm install git+https://github.com/owner/repo.git
SSHメソッド (SSHキー設定済みの場合)
npm install -g git+ssh://git@github.com:JEO-tech-ai/supercode.git#main
詳細ログ
npm install -g git+https://github.com/JEO-tech-ai/supercode.git#main --verbose
2. npm installのフロー
Git URLからインストールする際にnpmが実行すること:
1. Git Clone
└─ 指定されたブランチ (#main) でリポジトリをクローン
↓
2. Install Dependencies
└─ package.json内の依存関係をインストール
↓
3. Run Prepare Script
└─ "prepare"スクリプトを実行 (TypeScriptコンパイル、ビルドなど)
↓
4. Register Global Binary
└─ binフィールドの実行可能ファイルをグローバルパスにリンク
内部操作
# npmが内部的に行うこと
git clone https://github.com/owner/repo.git /tmp/npm-xxx
cd /tmp/npm-xxx
git checkout main
npm install
npm run prepare # 存在すれば実行
cp -r . /usr/local/lib/node_modules/repo/
ln -s ../lib/node_modules/repo/bin/cli.js /usr/local/bin/repo
3. インストール場所の確認
# グローバルnpmパスの確認
npm root -g
# macOS/Linux: /usr/local/lib/node_modules
# Windows: C:\Users\<username>\AppData\Roaming\npm\node_modules
# インストール済みパッケージの確認
npm list -g <package-name>
# バイナリの場所の確認
which <command>
# または
npm bin -g
プラットフォームごとのインストール場所
| プラットフォーム | パッケージの場所 | バイナリの場所 |
|---|---|---|
| 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. package.jsonへの依存関係の追加
dependenciesでGit URLを使用する
{
"dependencies": {
"supercode": "git+https://github.com/JEO-tech-ai/supercode.git#main",
"my-package": "git+ssh://git@github.com:owner/repo.git#v1.0.0",
"another-pkg": "github:owner/repo#branch"
}
}
短縮構文
{
"dependencies": {
"pkg1": "github:owner/repo",
"pkg2": "github:owner/repo#branch",
"pkg3": "github:owner/repo#v1.0.0",
"pkg4": "github:owner/repo#commit-sha"
}
}
5. プライベートリポジトリからのインストール
SSHキーメソッド (推奨)
# 1. SSHキーを生成
ssh-keygen -t ed25519 -C "your_email@example.com"
# 2. GitHubに公開キーを登録
cat ~/.ssh/id_ed25519.pub
# GitHub → Settings → SSH Keys → New SSH Key
# 3. SSHメソッドでインストール
npm install git+ssh://git@github.com:owner/private-repo.git
パーソナルアクセストークンメソッド
# 1. GitHubでPATを作成
# GitHub → Settings → Developer settings → Personal access tokens
# 2. URLにトークンを含めてインストール
npm install git+https://<token>@github.com/owner/private-repo.git
# 3. 環境変数を使用 (セキュリティのため推奨)
export GITHUB_TOKEN=ghp_xxxxxxxxxxxx
npm install git+https://${GITHUB_TOKEN}@github.com/owner/private-repo.git
.npmrc設定
# ~/.npmrc
//github.com/:_authToken=${GITHUB_TOKEN}
6. よくあるエラーと解決策
Permission denied (EACCES)
# 方法1: 所有者を変更
sudo chown -R $(whoami) /usr/local/lib/node_modules
# 方法2: npmディレクトリを変更 (推奨)
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Gitがインストールされていない
# macOS
brew install git
# Ubuntu/Debian
sudo apt-get install git
# Windows
# https://git-scm.com/download/win
GitHub認証エラー
# SSH接続をテスト
ssh -T git@github.com
# 認証情報をキャッシュ
git config --global credential.helper store
# または macOS
git config --global credential.helper osxkeychain
prepareスクリプトの失敗
# TypeScriptプロジェクトの場合
npm install -g typescript
# ビルド失敗時の詳細ログ
npm install git+https://... --verbose 2>&1 | tee npm-install.log
キャッシュの問題
# npmキャッシュをクリア
npm cache clean --force
# 再インストール
npm uninstall -g <package>
npm install -g git+https://...
7. 更新と管理
更新
# 最新バージョンに更新 (再インストール)
npm uninstall -g <package>
npm install -g git+https://github.com/owner/repo.git#main
# package.jsonの依存関係を更新
npm update <package>
バージョンの確認
# インストール済みバージョンの確認
npm list -g <package>
# リモートの最新コミットの確認
git ls-remote https://github.com/owner/repo.git HEAD
削除
npm uninstall -g <package>
8. Cursor/VS Code拡張機能の統合例
Supercodeインストール例
# グローバルインストール
npm install -g git+https://github.com/JEO-tech-ai/supercode.git#main
# インストールの確認
supercode --version
プロジェクト設定ファイル
// .supercoderc or supercode.config.json
{
"aiRules": {
"enabled": true,
"techStack": ["TypeScript", "React", "Node.js"]
},
"smartActions": [
{
"name": 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
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
npm install git+https://github.com/<owner>/<repo>.git#<branch|tag|commit>
HTTPS Method (Common)
# 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)
npm install -g git+ssh://git@github.com:JEO-tech-ai/supercode.git#main
Verbose Logging
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
# 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
# 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
{
"dependencies": {
"supercode": "git+https://github.com/JEO-tech-ai/supercode.git#main",
"my-package": "git+ssh://git@github.com:owner/repo.git#v1.0.0",
"another-pkg": "github:owner/repo#branch"
}
}
Shorthand Syntax
{
"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)
# 1. Generate SSH key
ssh-keygen -t ed25519 -C "your_email@example.com"
# 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://git@github.com:owner/private-repo.git
Personal Access Token Method
# 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
# ~/.npmrc
//github.com/:_authToken=${GITHUB_TOKEN}
6. Common Errors & Solutions
Permission denied (EACCES)
# 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
# macOS
brew install git
# Ubuntu/Debian
sudo apt-get install git
# Windows
# https://git-scm.com/download/win
GitHub Authentication Error
# Test SSH connection
ssh -T git@github.com
# Cache credentials
git config --global credential.helper store
# or macOS
git config --global credential.helper osxkeychain
prepare Script Failure
# 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
# Clear npm cache
npm cache clean --force
# Reinstall
npm uninstall -g <package>
npm install -g git+https://...
7. Update & Manage
Update
# 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
# Check installed version
npm list -g <package>
# Check remote latest commit
git ls-remote https://github.com/owner/repo.git HEAD
Remove
npm uninstall -g <package>
8. Cursor/VS Code Extension Integration Example
Supercode Installation Example
# Global install
npm install -g git+https://github.com/JEO-tech-ai/supercode.git#main
# Verify installation
supercode --version
Project Configuration File
// .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)
- Use Specific Version/Tag: Pin version with
#v1.0.0format - Prefer SSH Method: Use SSH key when accessing private repos
- Manage Token via Environment Variables: Store PAT in env vars
- Commit Lockfile: Ensure reproducibility by committing package-lock.json
- Use Verbose Option: Check detailed logs when issues occur
DON'T (Prohibited)
- Hardcode Tokens: Do not input tokens directly in package.json
- Depend on Latest Commit: Use tags instead of
#mainin production - Abuse sudo: Resolve permission issues with directory configuration
- Ignore Cache: Clear cache when experiencing unusual behavior
Constraints
Required Rules (MUST)
- Git Must Be Installed: Verify git is installed before npm git URL install
- Network Access: Environment with access to GitHub required
- Node.js Version: Check engines field in package.json
Prohibited (MUST NOT)
- Expose Auth Tokens: Do not expose tokens in logs or code
- Indiscriminate sudo: Resolve permission issues with configuration
- Use #main in Production: Pin to specific version/tag
References
- npm-install Official Documentation
- How To Install NPM Packages Directly From GitHub
- npm install from GitHub - Stack Overflow
- Working with the npm registry - GitHub Docs
Metadata
Version
- Current Version: 1.0.0
- Last Updated: 2026-01-10
- Compatible Platforms: Claude, ChatGPT, Gemini, Opencode
Related Skills
Tags
#npm #git #github #install #package-management #node