| 作用 | npm | yarn | pnpm |
|---|---|---|---|
| 安装 | npm install | yarn install | pnpm install |
| 安装的简写 | npm i | yarn add | pnpm add |
| 强制安装 | pnpm install --force | ||
| 卸载 | npm unintall | yarn remove | pnpm remove |
| 卸载简写 | npm rm | yarn rm | pnpm rm |
| 全局安装 | npm i xxx --global/-g | yarn global add xxx | pnpm add -g xxx |
| 安装包(生产模式) | npm i xxx --save/-S | yarn add xxx | pnpm add xxx |
| 开发模式安装包 | npm i xxx --save-dev/-D | yarn add xxx -dev/-D | pnpm add -D xxx |
| 检查更新 | npm outdated | ||
| 更新 | npm update | yarn upgrade | pnpm update |
| 全局更新 | npm update -g | yarn global upgrade | pnpm update -g |
| 运行 | npm run xxx | yarn run | pnpm run xxx |
| 清除缓存 | npm cache clean | yarn cache clean | |
| 动态包执行 | npx xxx | yarn dlx xxx | pnpm dlx xxx |
| 查看全局安装的包 | npm list -g --depth 0 | yarn global list | pnpm list -g |
【备忘】npm yarn pnpm 命令对比
FTLIKON2024-04-13 14:44
相关推荐
Mh1 小时前
Three.js 实现 3D 汽车交互2.0版本2601_958352902 小时前
I2S转模拟音频,真的只要5个引脚+1个电容?workflower4 小时前
如何培养FDE-3小小测试开发5 小时前
rsync 源路径少一个斜杠,--delete 删的就不是你以为的那一层无限聚核5 小时前
Node.js 对接美团、抖音团购核销接口:fetch 超时分类、重试和撤销一份代码跑通,无限聚核智购科技无人售货机工厂店5 小时前
自动售货机刷脸支付集成实战:活体检测与合规门槛~YH夕水8 小时前
我把颜色选择器拆成了 15 个插件,最后长成了 22 个包大今野8 小时前
2026 专转本计算机|移动互联网关键技术:SOA、Web2.0 与 HTML5 考点全解(附例题)JudithHuang8 小时前
Vue3 与后端联调:代理、Mock 与接口约定