NPM, Yarn & PNPM
Install CommitWeave using Node.js package managers
The most common way to install CommitWeave is through Node.js package managers. Choose your preferred method below.
Installation Methods
Global Installation (Recommended)
Install CommitWeave globally to use it in any Git repository:
npm install -g @typeweaver/commitweaveyarn global add @typeweaver/commitweavepnpm add -g @typeweaver/commitweaveGlobal installation allows you to use commitweave command from anywhere on your system.
Project-Specific Installation
Install CommitWeave as a development dependency in a specific project:
npm install --save-dev @typeweaver/commitweaveyarn add --dev @typeweaver/commitweavepnpm add -D @typeweaver/commitweaveAdding NPM Scripts
Add convenient scripts to your package.json:
{
"scripts": {
"commit": "commitweave",
"commit:ai": "commitweave --ai",
"commit:check": "commitweave check"
}
}Then use with:
npm run commit
npm run commit:aiyarn commit
yarn commit:aipnpm commit
pnpm commit:aiVerification
After installation, verify CommitWeave is working:
# Check version
commitweave --version
# Test help command
commitweave --help
# Test in a Git repository (dry run)
cd /path/to/your/git/repo
commitweave --previewTroubleshooting
Permission Issues
Global Install Permissions
If you encounter permission errors during global installation:
# Option 1: Use npx (no global install)
npx @typeweaver/commitweave
# Option 2: Change npm prefix
npm config set prefix ~/.npm-global
export PATH=~/.npm-global/bin:$PATH
npm install -g @typeweaver/commitweave# Check yarn global directory
yarn global dir
# Add to PATH if needed
export PATH="$(yarn global dir)/node_modules/.bin:$PATH"# pnpm handles permissions better, but if issues occur:
pnpm config set store-dir ~/.pnpm-storeNode.js Issues
Version Compatibility
CommitWeave requires Node.js 18.0 or higher.
Check and upgrade your Node.js version:
# Check current version
node --version
# Upgrade using n (if installed)
npm install -g n
n latest
# Or upgrade using nvm (if installed)
nvm install --lts
nvm use --ltsPackage Not Found
If you get "package not found" errors, ensure you're using the correct package name:
- ✅ Correct:
@typeweaver/commitweave - ❌ Incorrect:
commitweave
The package is scoped under @typeweaver organization.