计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
dev-swarm-nodejs【效率与协作】Install and configure Node.js, npm, and pnpm using nvm. Use when setting up a Node.js environment.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
This skill assists in installing and configuring the Node.js environment, including nvm (Node Version Manager), Node.js (LTS), and pnpm.
curl or wget.As an expert in your assigned roles, you must announce your actions before performing them using the following format:
As a {Role} [and {Role}, ...], I will {action description}
This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
Before installing, check if Node.js or pnpm are already installed.
node --version
pnpm --version
If they are installed and meet requirements, you may skip installation steps. Always ask the user for confirmation before overwriting or modifying existing installations.
macOS and Linux:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
Note: You may need to restart the shell or source the profile file (e.g., source ~/.zshrc) to use nvm.
Windows:
Download and run the installer from: https://github.com/coreybutler/nvm-windows/releases/download/1.2.2/nvm-setup.exe
Install the latest LTS (Long Term Support) version of Node.js.
nvm install lts/jod
nvm use lts/jod
(As of this writing, lts/jod points to v22.x. Adjust if a specific version is required).
We use pnpm instead of npm for this project.
Enable pnpm via corepack (included with recent Node.js versions):
npm install --global corepack@latest
corepack enable pnpm
verify:
pnpm --version
For any command that typically uses npx package, use pnpm dlx package in this project.
After successful installation, save the package manager preference to dev-swarm/user_preferences.md so future sessions remember to use pnpm.
Example:
Create or update dev-swarm/user_preferences.md with:
## Node.js Package Manager
- Use **pnpm** for all Node.js package operations (instead of npm)
- Node.js version: LTS (jod - v22.x)
- For executing packages, use `pnpm dlx` instead of `npx`