作用 | 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
相关推荐
Mr_Mao2 小时前
Naive Ultra:中后台 Naive UI 增强组件库前端小趴菜053 小时前
React-React.memo-props比较机制摸鱼仙人~4 小时前
styled-components:现代React样式解决方案sasaraku.5 小时前
serviceWorker缓存资源RadiumAg6 小时前
记一道有趣的面试题yangzhi_emo6 小时前
ES6笔记2yanlele6 小时前
我用爬虫抓取了 25 年 5 月掘金热门面试文章中微子7 小时前
React状态管理最佳实践烛阴7 小时前
void 0 的奥秘:解锁 JavaScript 中 undefined 的正确打开方式中微子7 小时前
JavaScript 事件与 React 合成事件完全指南:从入门到精通