What is the problem?
新手遇到 npm command not found 时,先确认 Node.js 是否安装、npm 是否随 Node 可用、终端 PATH 是否刷新、项目是否要求 pnpm 或 yarn。本文给出本地排查步骤和项目边界。
Quick solution
Treat this as a Node.js errors tutorial issue. First confirm the environment, inputs, permissions, logs, and delivery boundary. Then use the linked deep guide for the full checklist before changing production code or promising a result.
Read the deep guideDetailed steps
- `package-lock.json` 通常对应 npm
- `pnpm-lock.yaml` 通常对应 pnpm
- `yarn.lock` 通常对应 yarn
- `package.json` 可能写了 `packageManager`
Commands or code
node -v
npm -vRisk notes
Confirm the real project environment, account permissions, platform rules, and output quality before delivery. Do not ship AI-generated changes without human review, and do not claim indexing, income, deployment success, or ranking improvements without measured evidence.