Full-stack-skills nvm-global-packages
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.
git clone https://github.com/partme-ai/full-stack-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/partme-ai/full-stack-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/nvm-skills/nvm-global-packages" ~/.claude/skills/partme-ai-full-stack-skills-nvm-global-packages && rm -rf "$T"
skills/nvm-skills/nvm-global-packages/SKILL.mdnvm Global Packages
Manage global npm packages across Node version switches to avoid losing tools like eslint, typescript, or pm2.
Workflow
-
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.
Example file map
- Migration between versionsexamples/migrate-global-packages.md
- Default packages file setupexamples/default-global-packages.md
Keywords
global packages, default-packages, reinstall-packages-from, npm global, consistency