{"id":17021,"library":"install-peers-cli","title":"Install Peers CLI","description":"install-peers-cli is a command-line interface (CLI) tool designed to manage and install a project's `peerDependencies` without unintended side effects. Currently at stable version 2.2.0, it supports both `npm` and `yarn` package managers, including `yarn workspaces`. A key differentiator is its \"pure\" approach: it installs peer dependencies without modifying the project's `package.json` file or updating lock files (like `package-lock.json` or `yarn.lock`). This ensures a clean development environment and predictable dependency resolution, allowing developers to manage peer dependencies manually or through CI/CD pipelines without altering the project's core dependency manifests. The release cadence appears irregular, driven by contributions and specific feature needs, rather than a fixed schedule.","status":"active","version":"2.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/alexindigo/install-peers-cli","tags":["javascript","peerdependencies","peers","peerdeps","dev","devdeps","devdependencies","install","npm"],"install":[{"cmd":"npm install install-peers-cli","lang":"bash","label":"npm"},{"cmd":"yarn add install-peers-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add install-peers-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a CLI tool and its primary use is via command-line execution (e.g., via `npx` or `npm/yarn run` scripts), not programmatic `import` statements.","wrong":"import { installPeers } from 'install-peers-cli'","symbol":"install-peers command","correct":"npx install-peers-cli"},{"note":"The recommended way to integrate this CLI into a project is by adding it as a `devDependency` and defining a `package.json` script to run it.","wrong":"npm install install-peers-cli && install-peers","symbol":"package.json script integration","correct":"{ \"scripts\": { \"install-peers\": \"install-peers\" } }"},{"note":"If `install-peers-cli` is installed locally as a `devDependency` but not via an npm/yarn script or `npx`, it must be executed from `node_modules/.bin` or added to your PATH.","wrong":"install-peers","symbol":"Direct local execution","correct":"./node_modules/.bin/install-peers"}],"quickstart":{"code":"{\n  \"name\": \"my-project\",\n  \"version\": \"1.0.0\",\n  \"peerDependencies\": {\n    \"react\": \">=16.8.0\",\n    \"react-dom\": \">=16.8.0\"\n  },\n  \"scripts\": {\n    \"install-peers\": \"install-peers\"\n  },\n  \"devDependencies\": {\n    \"install-peers-cli\": \"^2.2.0\"\n  }\n}\n\n// Install the CLI tool as a devDependency\n$ npm install --save-dev install-peers-cli\n\n// Then, run the script to install peer dependencies\n$ npm run install-peers\n// or using yarn\n$ yarn add --dev install-peers-cli\n$ yarn install-peers","lang":"javascript","description":"This quickstart demonstrates how to add `install-peers-cli` as a development dependency and use a `package.json` script to install declared `peerDependencies`."},"warnings":[{"fix":"These warnings are often harmless in this context. Ensure your `peerDependencies` are correctly listed and installed via the `install-peers` script.","message":"Despite using `install-peers-cli`, you may still encounter 'unmet peer dependency' warnings during a regular `npm install` or `yarn install`. This is expected behavior as this CLI runs after the main installation phase and doesn't modify how package managers initially process `peerDependencies`.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Manually review and update `peerDependencies` versions in your `package.json` to ensure they align with the versions of the packages they depend on.","message":"`install-peers-cli` does not perform version resolution or compatibility checks for peer dependencies. It simply attempts to install the specified versions. It is the developer's responsibility to ensure that the declared `peerDependencies` are compatible with the consuming project's direct dependencies.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always execute the command via `npm run install-peers` (if defined in scripts), `npx install-peers-cli`, or specify the full path to the executable: `./node_modules/.bin/install-peers`.","message":"Executing `install-peers` directly from the command line without `npm run` or `npx` may result in a 'command not found' error if `install-peers-cli` is only installed locally and not in your system's PATH.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Use `npm run install-peers` (if configured in `package.json` scripts) or `npx install-peers-cli`.","cause":"The `install-peers` executable is not in your system's PATH, typically because it's a locally installed `devDependency`.","error":"install-peers: command not found"},{"fix":"Check the output immediately preceding this error for more specific details from `install-peers-cli` (e.g., dependency resolution issues, network problems).","cause":"An error occurred during the execution of the `install-peers` script defined in your `package.json`.","error":"npm ERR! Failed at the my-package@1.0.0 install-peers script."},{"fix":"Ensure `install-peers-cli` is installed as a `devDependency` and run it using `npm run install-peers` or `npx install-peers-cli`.","cause":"This is the Windows equivalent of 'command not found', indicating the executable is not accessible from your current shell.","error":"'install-peers' is not recognized as an internal or external command, operable program or batch file."}],"ecosystem":"npm","meta_description":null}