Skip to content

Instantly share code, notes, and snippets.

@jonlabelle
Last active September 16, 2025 04:15
Show Gist options
  • Save jonlabelle/c082700c1c249d986faecbd5abf7d65b to your computer and use it in GitHub Desktop.
Save jonlabelle/c082700c1c249d986faecbd5abf7d65b to your computer and use it in GitHub Desktop.

Revisions

  1. jonlabelle revised this gist Mar 31, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion npm_vs_yarn_command_translation_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ source: https://yarnpkg.com/en/docs/migrating-from-npm

    | npm | Yarn |
    |-------------------------------------------|---------------------------------|
    | `yarn init` | `npm init` |
    | `npm init` | `yarn init` |
    | `npm install` | `yarn install` |
    | `(N/A)` | `yarn install --flat` |
    | `(N/A)` | `yarn install --har` |
  2. jonlabelle revised this gist Feb 15, 2020. 1 changed file with 27 additions and 27 deletions.
    54 changes: 27 additions & 27 deletions npm_vs_yarn_command_translation_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -8,30 +8,30 @@ source: https://yarnpkg.com/en/docs/migrating-from-npm

    # npm vs Yarn Command Translation Cheat Sheet

    | npm | Yarn |
    |-------------------------------------------|-----------------------------------|
    | `yarn init` | `npm init` |
    | `npm install` | `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 update --global` | `yarn global upgrade` |
    | `npm rebuild` | `yarn add --force` |
    | `npm uninstall [package]` | `(N/A)` |
    | `npm uninstall --save [package]` | `yarn remove [package]` |
    | `npm uninstall --save-dev [package]` | `yarn remove [package]` |
    | `npm uninstall --save-optional [package]` | `yarn remove [package]` |
    | `npm cache clean` | `yarn cache clean` |
    | `rm -rf node_modules && npm install` | `yarn upgrade` |
    | `npm version major` | `yarn version --major` |
    | `npm version minor` | `yarn version --minor` |
    | `npm version patch` | `yarn version --patch` |
    | npm | Yarn |
    |-------------------------------------------|---------------------------------|
    | `yarn init` | `npm init` |
    | `npm install` | `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 update --global` | `yarn global upgrade` |
    | `npm rebuild` | `yarn add --force` |
    | `npm uninstall [package]` | `(N/A)` |
    | `npm uninstall --save [package]` | `yarn remove [package]` |
    | `npm uninstall --save-dev [package]` | `yarn remove [package]` |
    | `npm uninstall --save-optional [package]` | `yarn remove [package]` |
    | `npm cache clean` | `yarn cache clean` |
    | `rm -rf node_modules && npm install` | `yarn upgrade` |
    | `npm version major` | `yarn version --major` |
    | `npm version minor` | `yarn version --minor` |
    | `npm version patch` | `yarn version --patch` |
  3. jonlabelle revised this gist Feb 15, 2020. 1 changed file with 28 additions and 24 deletions.
    52 changes: 28 additions & 24 deletions npm_vs_yarn_command_translation_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -2,32 +2,36 @@
    title: npm vs Yarn Command Translation Cheat Sheet
    subtitle: CLI commands comparison
    author: yarn
    date: July 2, 2017
    date: February 15, 2020
    source: https://yarnpkg.com/en/docs/migrating-from-npm
    ---

    # npm vs Yarn Command Translation Cheat Sheet

    | npm | Yarn |
    |-------------------------------------------|--------------------------------------|
    | `npm install` | `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/-D]` |
    | `(N/A)` | `yarn add [package] [--peer/-P]` |
    | `npm install --save-optional [package]` | `yarn add [package] [--optional/-O]` |
    | `npm install --save-exact [package]` | `yarn add [package] [--exact/-E]` |
    | `(N/A)` | `yarn add [package] [--tilde/-T]` |
    | `npm install --global [package]` | `yarn global add [package]` |
    | `npm update --global` | `yarn global upgrade` |
    | `npm rebuild` | `yarn install --force` |
    | `npm uninstall [package]` | `(N/A)` |
    | `npm uninstall --save [package]` | `yarn remove [package]` |
    | `npm uninstall --save-dev [package]` | `yarn remove [package]` |
    | `npm uninstall --save-optional [package]` | `yarn remove [package]` |
    | `npm cache clean` | `yarn cache clean` |
    | `rm -rf node_modules && npm install` | `yarn upgrade` |
    | npm | Yarn |
    |-------------------------------------------|-----------------------------------|
    | `yarn init` | `npm init` |
    | `npm install` | `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 update --global` | `yarn global upgrade` |
    | `npm rebuild` | `yarn add --force` |
    | `npm uninstall [package]` | `(N/A)` |
    | `npm uninstall --save [package]` | `yarn remove [package]` |
    | `npm uninstall --save-dev [package]` | `yarn remove [package]` |
    | `npm uninstall --save-optional [package]` | `yarn remove [package]` |
    | `npm cache clean` | `yarn cache clean` |
    | `rm -rf node_modules && npm install` | `yarn upgrade` |
    | `npm version major` | `yarn version --major` |
    | `npm version minor` | `yarn version --minor` |
    | `npm version patch` | `yarn version --patch` |
  4. jonlabelle revised this gist Dec 13, 2019. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions npm_vs_yarn_command_translation_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -11,21 +11,21 @@ source: https://yarnpkg.com/en/docs/migrating-from-npm
    | npm | Yarn |
    |-------------------------------------------|--------------------------------------|
    | `npm install` | `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) |
    | `(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/-D]` |
    | (N/A) | `yarn add [package] [--peer/-P]` |
    | `(N/A)` | `yarn add [package] [--peer/-P]` |
    | `npm install --save-optional [package]` | `yarn add [package] [--optional/-O]` |
    | `npm install --save-exact [package]` | `yarn add [package] [--exact/-E]` |
    | (N/A) | `yarn add [package] [--tilde/-T]` |
    | `(N/A)` | `yarn add [package] [--tilde/-T]` |
    | `npm install --global [package]` | `yarn global add [package]` |
    | `npm update --global` | `yarn global upgrade` |
    | `npm rebuild` | `yarn install --force` |
    | `npm uninstall [package]` | (N/A) |
    | `npm uninstall [package]` | `(N/A)` |
    | `npm uninstall --save [package]` | `yarn remove [package]` |
    | `npm uninstall --save-dev [package]` | `yarn remove [package]` |
    | `npm uninstall --save-optional [package]` | `yarn remove [package]` |
  5. jonlabelle revised this gist Dec 13, 2019. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions npm_vs_yarn_command_translation_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -11,21 +11,21 @@ source: https://yarnpkg.com/en/docs/migrating-from-npm
    | npm | Yarn |
    |-------------------------------------------|--------------------------------------|
    | `npm install` | `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)` |
    | (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/-D]` |
    | `(N/A)` | `yarn add [package] [--peer/-P]` |
    | (N/A) | `yarn add [package] [--peer/-P]` |
    | `npm install --save-optional [package]` | `yarn add [package] [--optional/-O]` |
    | `npm install --save-exact [package]` | `yarn add [package] [--exact/-E]` |
    | `(N/A)` | `yarn add [package] [--tilde/-T]` |
    | (N/A) | `yarn add [package] [--tilde/-T]` |
    | `npm install --global [package]` | `yarn global add [package]` |
    | `npm update --global` | `yarn global upgrade` |
    | `npm rebuild` | `yarn install --force` |
    | `npm uninstall [package]` | `(N/A)` |
    | `npm uninstall [package]` | (N/A) |
    | `npm uninstall --save [package]` | `yarn remove [package]` |
    | `npm uninstall --save-dev [package]` | `yarn remove [package]` |
    | `npm uninstall --save-optional [package]` | `yarn remove [package]` |
  6. jonlabelle revised this gist Dec 13, 2019. 1 changed file with 23 additions and 23 deletions.
    46 changes: 23 additions & 23 deletions npm_vs_yarn_command_translation_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -8,26 +8,26 @@ source: https://yarnpkg.com/en/docs/migrating-from-npm

    # npm vs Yarn Command Translation Cheat Sheet

    | npm | Yarn |
    |-----------------------------------------|------------------------------------|
    | npm install | 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/-D] |
    | (N/A) | yarn add [package] [--peer/-P] |
    | npm install --save-optional [package] | yarn add [package] [--optional/-O] |
    | npm install --save-exact [package] | yarn add [package] [--exact/-E] |
    | (N/A) | yarn add [package] [--tilde/-T] |
    | npm install --global [package] | yarn global add [package] |
    | npm update --global | yarn global upgrade |
    | npm rebuild | yarn install --force |
    | npm uninstall [package] | (N/A) |
    | npm uninstall --save [package] | yarn remove [package] |
    | npm uninstall --save-dev [package] | yarn remove [package] |
    | npm uninstall --save-optional [package] | yarn remove [package] |
    | npm cache clean | yarn cache clean |
    | rm -rf node_modules && npm install | yarn upgrade |
    | npm | Yarn |
    |-------------------------------------------|--------------------------------------|
    | `npm install` | `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/-D]` |
    | `(N/A)` | `yarn add [package] [--peer/-P]` |
    | `npm install --save-optional [package]` | `yarn add [package] [--optional/-O]` |
    | `npm install --save-exact [package]` | `yarn add [package] [--exact/-E]` |
    | `(N/A)` | `yarn add [package] [--tilde/-T]` |
    | `npm install --global [package]` | `yarn global add [package]` |
    | `npm update --global` | `yarn global upgrade` |
    | `npm rebuild` | `yarn install --force` |
    | `npm uninstall [package]` | `(N/A)` |
    | `npm uninstall --save [package]` | `yarn remove [package]` |
    | `npm uninstall --save-dev [package]` | `yarn remove [package]` |
    | `npm uninstall --save-optional [package]` | `yarn remove [package]` |
    | `npm cache clean` | `yarn cache clean` |
    | `rm -rf node_modules && npm install` | `yarn upgrade` |
  7. jonlabelle revised this gist Jul 2, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions npm_vs_yarn_command_translation_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,8 @@ date: July 2, 2017
    source: https://yarnpkg.com/en/docs/migrating-from-npm
    ---

    # npm vs Yarn Command Translation Cheat Sheet

    | npm | Yarn |
    |-----------------------------------------|------------------------------------|
    | npm install | yarn install |
  8. jonlabelle created this gist Jul 2, 2017.
    31 changes: 31 additions & 0 deletions npm_vs_yarn_command_translation_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    ---
    title: npm vs Yarn Command Translation Cheat Sheet
    subtitle: CLI commands comparison
    author: yarn
    date: July 2, 2017
    source: https://yarnpkg.com/en/docs/migrating-from-npm
    ---

    | npm | Yarn |
    |-----------------------------------------|------------------------------------|
    | npm install | 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/-D] |
    | (N/A) | yarn add [package] [--peer/-P] |
    | npm install --save-optional [package] | yarn add [package] [--optional/-O] |
    | npm install --save-exact [package] | yarn add [package] [--exact/-E] |
    | (N/A) | yarn add [package] [--tilde/-T] |
    | npm install --global [package] | yarn global add [package] |
    | npm update --global | yarn global upgrade |
    | npm rebuild | yarn install --force |
    | npm uninstall [package] | (N/A) |
    | npm uninstall --save [package] | yarn remove [package] |
    | npm uninstall --save-dev [package] | yarn remove [package] |
    | npm uninstall --save-optional [package] | yarn remove [package] |
    | npm cache clean | yarn cache clean |
    | rm -rf node_modules && npm install | yarn upgrade |