skills/nvm-skills/nvm-global-packages/SKILL.md
Migrate npm global packages between Node versions using reinstall-packages-from, and define a default-packages file to auto-install globals on every new version. Use when the user asks about keeping global packages after switching Node versions, setting up default npm packages, or troubleshooting missing global packages after nvm install.
npx skillsauth add teachingai/agent-skills nvm-global-packagesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Manage global npm packages across Node version switches to avoid losing tools like eslint, typescript, or pm2.
Migrate global packages when installing a new version:
# Install Node 20 and copy global packages from Node 18
nvm install 20 --reinstall-packages-from=18
# Verify packages migrated
npm list -g --depth=0
Configure default-packages for automatic installation on every new version:
# Create the default-packages file
cat > "$NVM_DIR/default-packages" << 'EOF'
typescript
eslint
pm2
nodemon
EOF
# New installs will auto-install these packages
nvm install 22 # typescript, eslint, pm2, nodemon installed automatically
Verify and validate global packages:
npm list -g --depth=0
Warning: Global packages are version-specific. Switching versions without --reinstall-packages-from means previously installed globals will not be available.
examples/migrate-global-packages.md - Migration between versionsexamples/default-global-packages.md - Default packages file setupglobal packages, default-packages, reinstall-packages-from, npm global, consistency
development
Guidance for Next.js using the official docs at nextjs.org/docs. Use when the user needs Next.js concepts, configuration, routing, data fetching, or API reference details.
tools
Provides comprehensive guidance for Flask framework including routing, templates, forms, database integration, extensions, and deployment. Use when the user asks about Flask, needs to create web applications, implement routes, or build Python web services.
development
Provides comprehensive guidance for FastAPI framework including routing, request validation, dependency injection, async operations, OpenAPI documentation, and database integration. Use when the user asks about FastAPI, needs to create REST APIs, or build high-performance Python web services.
development
Provides comprehensive guidance for Django framework including models, views, templates, forms, admin, REST framework, and deployment. Use when the user asks about Django, needs to create web applications, implement models and views, or build Django REST APIs.