📦找不到命令
zsh: command not found: npm
终端不认识这个程序。可能是程序没有安装,或者安装后没有重新打开终端。
🤔 为什么会出现?
- 还没有安装 Node.js(npm)、Git 这类程序
- 装是装了,但没有重新打开终端
- 命令拼错了
🔧 试试这样做
- 如果是 npm,就去 nodejs.org 安装 LTS 版本
- 安装完之后,把终端(或 VS Code)完全关掉再重新打开
- 用 node -v、git --version 确认是否安装成功
🤖 这样问 AI
终端里出现了下面的报错。我的电脑是 [Mac/Windows]。请一步步告诉我怎么安装需要的程序,以及怎么确认它已经装好了。 [在这里粘贴完整的报错]
把 [ ] 部分换成你的实际情况,报错前后的几行也尽量一起复制粘贴。
相关术语
同一分类的其他报错
- 找不到模块
Module not found: Can't resolve - 包版本冲突(ERESOLVE)
npm ERR! ERESOLVE unable to resolve dependency tree - 端口已被占用
EADDRINUSE: address already in use - 类型不匹配(TypeScript)
Type 'X' is not assignable to type 'Y' - 没有权限,安装不了(EACCES)
EACCES: permission denied - Node 版本不匹配
The engine "node" is incompatible with this module - 内存不足(heap out of memory)
JavaScript heap out of memory - 不能使用 import 语句(模块设置)
SyntaxError: Cannot use import statement outside a module - 代码检查(ESLint)没通过,构建失败
Failed to compile — ESLint errors - 找不到文件或文件夹(ENOENT)
ENOENT: no such file or directory