Help us understand the problem. What is going on with this article?

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

masterkey1009
株式会社ヴァルワークス(2019.1~)という会社でフロントエンジニアをしています。
https://misoniction.com
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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした