mcpField
N
nodejs-version-setup

nodejs-version-setup

github.com/xip-online-applicationsDevelopment046 installsUpdated 14w ago
Repository

About nodejs-version-setup

A skill for selecting and verifying a repository's required Node.js runtime before running Node.js tools. It is for developers using package managers, build scripts, tests, or local CLIs, and follows repository version declarations and available version managers.

Key features

  1. 01Check repository version declarations in order
  2. 02Detect installed version managers in order
  3. 03Select and install the required Node.js version
  4. 04Verify runtime and binary path before commands
  5. 05Ask for confirmation if no manager is available

Use cases

  1. 01Run repository npm, pnpm, or yarn commands
  2. 02Execute builds, tests, or linters
  3. 03Check Node.js before launching a local CLI
  4. 04Pause on a version mismatch without a manager

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/xip-online-applications/skills --skill nodejs-version-setup

After installing, type/nodejs-version-setupin Claude Code to confirm it loaded.

Details

From the project README

nodejs-version-setup

Set and verify the correct Node.js runtime for this repository before running any Node.js command.

When to use

Use this skill whenever the task runs Node.js tooling, including npm, pnpm, yarn, npx, build scripts, tests, linters, or local CLIs.

Instructions

  1. Detect the required Node.js version in this order:
    • .nvmrc
    • .node-version
    • package.json -> engines.node
  2. Detect an installed version manager in this order:
    • nvm
    • fnm
    • asdf
    • volta
  3. Select the required version with the first available manager:
    • nvm: nvm install and nvm use
    • fnm: fnm install and fnm use
    • asdf: asdf install nodejs <version> and asdf local nodejs <version>
    • volta: volta install node@<version>
  4. If no version file exists but engines.node exists, resolve a concrete version inside that range and install/use it with the detected manager.
  5. If no manager is available, check whether the current node -v satisfies the required version. If it does not, stop and ask the user to confirm whether to install a version manager or proceed manually.
  6. Verify runtime before executing project commands:
    • node -v
    • npm -v (or pnpm -v / yarn -v depending on the project)
    • which node to confirm the active binary path
  7. In task output, report which source defined the version (for example .nvmrc), which manager was used, and the final node -v.
  8. Do not run dependency install, build, test, or CLI scripts until version selection and verification are complete.

Comments

Markdown supported