AI 工具指南

NPM Command Not Found Fix

新手遇到 npm command not found 时,先确认 Node.js 是否安装、npm 是否随 Node 可用、终端 PATH 是否刷新、项目是否要求 pnpm 或 yarn。本文给出本地排查步骤和项目边界。

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 guide

Detailed steps

  1. `package-lock.json` 通常对应 npm
  2. `pnpm-lock.yaml` 通常对应 pnpm
  3. `yarn.lock` 通常对应 yarn
  4. `package.json` 可能写了 `packageManager`

Commands or code

node -v
npm -v

Risk 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.