放肆青春的博客
首页
前端
算法
网络
面试
技术
后端
运维
杂项
数据库
工具
网址
电脑
个人
文章
  • 分类
  • 标签
  • 归档
github (opens new window)
gitee (opens new window)

放肆青春

一个前端菜鸟的技术成长之路
首页
前端
算法
网络
面试
技术
后端
运维
杂项
数据库
工具
网址
电脑
个人
文章
  • 分类
  • 标签
  • 归档
github (opens new window)
gitee (opens new window)
  • 开发相关

    • 项目管理

      • 团队工具
      • git

      • UI 及 UE工具
      • 代码管理
      • jenkins
      • sonar
      • 移动端调试
      • nexus
    • 开发工具

      • node
      • npm
      • yarn
        • yarn
          • yarn 命令行
      • pm2
      • pnpm
      • safe
      • eslint
      • gitbook
      • vuepress 总结
      • vitepress
      • markdown
    • 开发软件

      • software
      • vscode
      • postman
      • SourceTree
      • idea
      • sublime
      • notepad
      • ediplus
      • xmind
    • 浏览器

      • chrome 汇总
      • chrome lighthouse
      • firefox
  • office

    • excel

      • excel
    • word

      • word
    • ppt

      • ppt
  • 实用工具

    • ps
    • premiere
  • tools
放肆青春
2020-07-09

yarn

# yarn

  • 文档地址:https://yarn.bootcss.com/ (opens new window)

# yarn 命令行

  • 初始化项目 yarn init

  • 安装全部依赖 yarn 或者 yarn install

  • 添加依赖包

yarn add [package]
yarn add [package]@[version]
yarn add [package]@[tag]
yarn add [package] --dev  (安装在 devDependencies 下)
yarn global add [package]  (全局安装包名)
1
2
3
4
5
  • 升级依赖包 yarn upgrade [package]

  • 移除依赖包 yarn remove [package]

  • 将当前模块发布到 npmjs.com,需要先登录 yarn publish

# 全局安装
yarn global add package

# 查看当前设置的镜像源地址
yarn config get registry

# 切换到国内taobao镜像
yarn config set registry 'https://registry.npm.taobao.org'

# 生成 package.json 文件(使用默认配置)
yarn init -y

# 列出 xxx 包的版本信息
yarn outdated xxx

# 验证当前项目 package.json 里的依赖版本和 yarn 的 lock 文件是否匹配
yarn check

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

npm 和 yarn 对比

更新时间: 6/11/2021, 10:00:02 AM
npm
pm2

← npm pm2→

最近更新
01
前端权限管理
02-24
02
vue2指令
02-24
03
vue2 hook
02-24
更多文章>
Theme by Vdoing | Copyright © 2019-2022 放肆青春
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式