一、简介
Apache Hadoop YARN (Yet Another Resource Negotiator,另一种资源协调者)是一种新的 Hadoop 资源管理器,它是一个通用资源管理系统,可为上层应用提供统一的资源管理和调度。
二、安装
1.要提前安装了node js才能进行使用npm,不然会有问题的。
npm install -g yarn
2.可以查看自己的版本
yarn --version
三、yarn常用命令
安装包:
yarn install //安装package.json里所有包,并将包及它的所有依赖项保存进yarn.lock
yarn install --flat //安装一个包的单一版本
yarn install --force //强制重新下载所有包
yarn install --production //只安装dependencies里的包
yarn install --no-lockfile //不读取或生成yarn.lock
yarn install --pure-lockfile //不生成yarn.lock
yarn add --exact/-E // 安装包的精确版本。例如yarn add foo@1.2.3会接受1.9.1版,但是yarn add foo@1.2.3 --exact只会接受1.2.3版
yarn add --tilde/-T // 安装包的次要版本里的最新版。例如yarn add foo@1.2.3 --tilde会接受1.2.9,但不接受1.3.0
发布包:
yarn pulish
移除一个包:
yarn remove <packageName> #移除一个包,会自动更新package.json和yarn.lock
更新一个依赖
yarn upgrade 用于更新包到基于规范范围的最新版本
运行脚本
yarn run #用来执行在 package.json 中 scripts 属性下定义的脚本
显示某个包的信息
yarn info <packageName> #可以用来查看某个模块的最新版本信息
缓存:
yarn cache
yarn cache list #列出已缓存的每个包