15
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

yarnを使ってみた

Last updated at Posted at 2016-10-16

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とかを使って行くことになりそう。

15
13
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?