| name | setup-node |
| description | Sets up Node.js/TypeScript development environment with npm/yarn, dependencies, ESLint, Prettier, testing (Jest/Vitest), and TypeScript type checking. Ensures consistent tooling configuration. Use when starting work on Node.js/TypeScript projects, after cloning repositories, setting up CI/CD, or troubleshooting environment issues. |
| version | 1.0.0 |
Node.js Development Setup Skill
Purpose
Quickly set up and verify a Node.js/TypeScript development environment with all necessary tooling.
Workflow
Quick Setup Checklist
- ✅ Verify Node.js 18+ and npm 9+
- ✅ Detect package manager (npm/yarn/pnpm)
- ✅ Install dependencies
- ✅ Verify package.json scripts
- ✅ Setup ESLint
- ✅ Setup Prettier
- ✅ Setup TypeScript (if applicable)
- ✅ Setup Testing (Jest/Vitest)
- ✅ Setup Git hooks (Husky + lint-staged)
- ✅ Verify build
- ✅ Run quality checks
- ✅ Test execution
For detailed step-by-step instructions with commands and troubleshooting, see references/DETAILED-WORKFLOW.md.
Common Node.js Commands Reference
Package Management
npm install <package>
npm install -D <package>
npm install -g <package>
npm uninstall <package>
npm update
npm outdated
npm audit
npm audit fix
Project Commands
npm run dev
npm run build
npm test
npm run lint
npm run format
Yarn Equivalents
yarn add <package>
yarn add -D <package>
yarn remove <package>
yarn upgrade
yarn audit
Troubleshooting
Issue: "npm: command not found"
Solution: Node.js not installed
brew install node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install node
Issue: "Cannot find module 'X'"
Solution: Dependencies not installed
rm -rf node_modules package-lock.json
npm install
Issue: "EACCES: permission denied"
Solution: Global npm permissions issue
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
Issue: "TypeScript errors in node_modules"
Solution: Skip library checking
{
"compilerOptions": {
"skipLibCheck": true
}
}
Issue: "ESLint and Prettier conflicts"
Solution: Install eslint-config-prettier
npm install --save-dev eslint-config-prettier
Add to .eslintrc.js:
extends: [
'prettier',
],
Best Practices
- Use Node version manager (nvm) - Easily switch Node versions
- Lock dependency versions - Commit package-lock.json
- Separate dev dependencies - Use --save-dev for tooling
- Enable TypeScript strict mode - Catch more errors
- Configure ESLint + Prettier - Consistent code style
- Use git hooks - Automate checks with Husky
- Target 90%+ coverage - Comprehensive testing
- Regular security audits - Run
npm audit frequently
Integration with Other Skills
This skill may be invoked by:
quality-check - When checking Node.js code quality
run-tests - When running Node.js tests