{"id":13583032,"url":"https://github.com/nathanhleung/install-peerdeps","last_synced_at":"2025-04-11T06:22:51.285Z","repository":{"id":38310721,"uuid":"77355893","full_name":"nathanhleung/install-peerdeps","owner":"nathanhleung","description":"💻 Quickly install an npm package and its peer dependencies automatically, using npm, Yarn, or pnpm.","archived":false,"fork":false,"pushed_at":"2025-03-24T01:07:09.000Z","size":280,"stargazers_count":295,"open_issues_count":22,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T15:08:07.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/install-peerdeps","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathanhleung.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-26T03:40:38.000Z","updated_at":"2025-03-24T02:03:27.000Z","dependencies_parsed_at":"2023-02-13T21:31:30.659Z","dependency_job_id":null,"html_url":"https://github.com/nathanhleung/install-peerdeps","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanhleung%2Finstall-peerdeps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanhleung%2Finstall-peerdeps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanhleung%2Finstall-peerdeps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanhleung%2Finstall-peerdeps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathanhleung","download_url":"https://codeload.github.com/nathanhleung/install-peerdeps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248352476,"owners_count":21089455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:03:12.418Z","updated_at":"2025-04-11T06:22:51.253Z","avatar_url":"https://github.com/nathanhleung.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# install-peerdeps\n\n\u003e As seen on the README of [Airbnb's ESLint config](https://www.npmjs.com/package/eslint-config-airbnb)!\n\n\u003e _Disclaimer: Airbnb is not affiliated with, and does not endorse, this CLI tool_\n\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/nathanhleung/install-peerdeps/node.yml) ![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/nathanhleung/install-peerdeps)\n\n[![npm total downloads](https://img.shields.io/npm/dt/install-peerdeps.svg)](https://www.npmjs.com/package/install-peerdeps) [![npm monthly downloads](https://img.shields.io/npm/dm/install-peerdeps.svg)](https://www.npmjs.com/package/install-peerdeps) ![GitHub stars](https://img.shields.io/github/stars/nathanhleung/install-peerdeps?style=social)\n\n[![Node version](https://img.shields.io/node/v/install-peerdeps.svg)](https://github.com/nathanhleung/install-peerdeps) [![npm version](https://badge.fury.io/js/install-peerdeps.svg)](https://www.npmjs.com/package/install-peerdeps)\n[![GitHub license](https://img.shields.io/github/license/nathanhleung/install-peerdeps.svg)](https://github.com/nathanhleung/install-peerdeps/blob/master/LICENSE)\n\n💻 Quickly install an npm package and its peer dependencies automatically, using npm, Yarn, or pnpm. \n\nStarting with npm v3.0, peer dependencies are not automatically installed on `npm install`, and it can be a hassle to install them all manually. The `install-peerdeps` tool makes the process fast and easy.\n\nAlso works with [Yarn](https://yarnpkg.com/) (with the `--yarn` flag) and [pnpm](https://pnpm.io/) (with the `--pnpm` flag).\n\n## Quick Start\n\n```\ncd my-project-directory\n\nnpx install-peerdeps \u003cpackage\u003e[@\u003cversion\u003e]\n\n# If you're using yarn\nyarn dlx install-peerdeps --yarn \u003cpackage\u003e[@\u003cversion\u003e]\n\n# If you're using pnpm\npnpm dlx install-peerdeps --pnpm \u003cpackage\u003e[@\u003cversion\u003e]\n```\n\nThe specified package along with its peer dependencies will be installed.\n\n## Why\n\nIt's true that on Linux you can run something like this to automatically install peerDeps (taken from [Airbnb's eslint config repo](https://github.com/airbnb/javascript)):\n\n```\n(\n  export PKG=eslint-config-airbnb;\n  npm info \"$PKG@latest\" peerDependencies --json | command sed 's/[\\{\\},]//g ; s/: /@/g' | xargs npm install --save-dev \"$PKG@latest\"\n)\n```\n\nHowever, the above solution is hard to remember, and doesn't work on Windows. This tool aims to solve both of these problems.\n\n## Usage\n\n```\nUsage: install-peerdeps \u003cpackage\u003e[@\u003cversion\u003e], default version is 'latest'\n\nInstalls the specified package along with correct peerDeps.\n\nOptions:\n  -V, --version                    output the version number\n  -D                               Install the package as a devDependency (alias for `-d`)\n  -d, --dev                        Install the package as a devDependency\n  -g, --global                     Install the package globally\n  -o, --only-peers                 Install only peerDependencies of the package\n  -S, --silent                     If using npm, don't save in package.json\n  -Y, --yarn                       Install with Yarn\n  -P, --pnpm                       Install with pnpm\n  -n, --no-registry                Do not use a remote registry to find dependencies list\n  --dry-run                        Do not install packages, but show the install command that will be run\n  -x, --extra-args \"\u003cextra_args\u003e\"  Extra arguments to pass through to the underlying package manager\n  -h, --help                       output usage information\n```\n\n### Extra Arguments\n\nOnly core npm, Yarn, and pnpm arguments relating to package installation are officially provided by `install-peerdeps`. However, if you'd like to pass through additional arguments, you may do so with `--extra-args`. Here's how you'd install a package into a Yarn-workspace-enabled repository:\n\n`install-peerdeps \u003cpackage\u003e --dev -Y --extra-args \"-W\"`\n\nHere's how you'd use `--extra-args` to pass a custom npm config option (in this case, disabling `strict-ssl` when accessing a custom registry over HTTPS):\n\n`install-peerdeps \u003cpackage\u003e --extra-args \"--strict-ssl false\"`\n\n## Examples\n\n### Basic Peer Dependency Installation\n\n`eslint-config-airbnb` requires quite a few peer dependencies. Here's what you'd do to install them all:\n\n`install-peerdeps eslint-config-airbnb --dev`\n\n`install-peerdeps` will automatically detect whether you're using Yarn. If you are, it'll prompt you as to whether you want to use Yarn or npm to install the packages.\n\n```\n# If you're using npm\nnpm install eslint-config-airbnb@18.2.1 eslint@^7.2.0 eslint-plugin-import@^2.22.1 eslint-plugin-jsx-a11y@^6.4.1 eslint-plugin-react@^7.21.5 eslint-plugin-react-hooks@^1.7.0 --save-dev\n\n# If you're using yarn\nyarn add eslint-config-airbnb@18.2.1 eslint@^7.2.0 eslint-plugin-import@^2.22.1 eslint-plugin-jsx-a11y@^6.4.1 eslint-plugin-react@^7.21.5 eslint-plugin-react-hooks@^1.7.0 --dev\n```\n\n### Installing a Different Version Tag\n\nIf you'd like to install a different version of a package than the latest (the default), simply specify the version like so:\n\n`install-peerdeps @angular/core@next`\n\nThe tool will automatically install the version corresponding to the tag, as well as its peer dependencies:\n\n```\nInstalling peerdeps for @angular/core@next.\nyarn add @angular/core@11.2.0-next.0 rxjs@^6.5.3 zone.js@^0.11.3 --dev\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/nathanhleung/install-peerdeps/blob/master/CONTRIBUTING.md)\n\n## License\n\n[MIT](https://github.com/nathanhleung/install-peerdeps/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanhleung%2Finstall-peerdeps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanhleung%2Finstall-peerdeps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanhleung%2Finstall-peerdeps/lists"}