Yarn
npm equivalents
| npm | yarn |
|---|---|
npm install |
yarn |
npm install gulp --save |
yarn add gulp |
npm install gulp --save-dev --save-exact |
yarn add gulp --dev --exact |
npm install -g gulp |
yarn global add gulp |
npm update |
yarn upgrade |
./node_modules/.bin/gulp |
yarn run gulp |
yarn install
1 | --no-lockfile |
These options are available for yarn install.
yarn add
1 | --dev |
These options are available for yarn add.
Workspaces
In package.json:
1 | "workspaces": [ |
1 | jest/ |
(New in 1.0) Allows monorepos to share packages with each other. See: Introducing workspaces
Selective version resolution
In package.json:
1 | "resolutions": { |
(New in 1.0) Allows you to specify versions for sub-dependencies. See: Selective version resolutions
Create
1 | yarn create react-app hello |
Install create-react-app and runs it. See: yarn create