Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
12
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

@masterkey1009

yarnを使ってみた

yarnを使ってみた

最近よく耳にするyarnとやらを使ってみた、その備忘録として。

yarnとは

Facebook,Exponent,Google,Tildeとの共同チームによって生まれた新しいパッケージマネージャ。

npmとの互換性があるので、既存のpackage.jsonはそのまま使える。

Lockfile

ユーザやデバイス間でのライブラリのバージョン違いを無くす。

npmshrinkwrapに相当する機能。

インストール

$ npm install -g yarn

Macでhomebrewを使っているなら

$ brew update
$ brew install yarn

で、.bash_profileにPATHを通す。

export PATH="$HOME/.yarn/bin:$PATH"

コマンド

npm yarn
(N/A) yarn install
(N/A) yarn install --flat
(N/A) yarn install -har
(N/A) yarn install -no-lockfile
(N/A) yarn install --pure-lockfile
npm install [package] (N/A)
npm install --save [package] yarn add [package]
npm install --save-dev [package] yarn add [package] --dev
(N/A) yarn add [package] --peer
npm install --save-optional [package] yarn add [package] --optional
npm install --save-exact [package] yarn add [package] --exact
(N/A) yarn add [package] --tilde
npm install --global [package] yarn global add [package]
npm uninstall [package] (N/A)
npm uninstall --save [package] yarn remove [package]
npm uninstall --save-dev [package] yarn remove [package]
(N/A) yarn upgrade [package]

optionについてはまだ調べきれていないが、基本的にはyarn add or yarn add -Dyarn removeとかを使って行くことになりそう。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
12
Help us understand the problem. What are the problem?