Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

install-peerdeps

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

install-peerdeps

CLI to automatically install peerDeps

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
increased by3.38%
Maintainers
1
Weekly downloads
 
Created
Source

install-peerdeps npm version Dependency Status

A command-line interface to install an NPM package and its peer dependencies automatically.

NPM v3 doesn't install peerDeps automatically anymore, and it can be a hassle to install them all — now you can, with install-peerdeps. Also works with Yarn.

Quick Start

# If you're using npm
npm install -g install-peerdeps

# If you're using yarn
yarn global add install-peerdeps

cd my-project-directory

install-peerdeps <package>[@<version>]

The specified package along with its peer dependencies will be installed.

Why

It's true that on Linux you can run something like this to automatically install peerDeps:

(
  export PKG=eslint-config-airbnb;
  npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)

However, the above solution is hard to remember, and doesn't work on Windows. This tool aims to solve both of these problems.

Usage

Usage: install-peerdeps <package>[@<version], default version is 'latest'

Installs the specified package along with correct peerDeps.

Options:

  -h, --help     output usage information
  -V, --version  output the version number
  -d, --dev      Install the package as a devDependency

Examples

eslint-config-airbnb

This package requires quite a few peer dependencies. Here's what you'd do to install them all:

install-peerdeps eslint-config-airbnb --dev

install-peerdeps will automatically detect whether you're using Yarn or NPM and run the appropriate command.

# If you're using npm
npm install eslint-config-airbnb eslint@^3.9.1 eslint-plugin-jsx-a11y@^2.2.3 eslint-plugin-import@^2.1.0 eslint-plugin
-react@^6.6.0 --save-dev

# If you're using yarn
yarn add eslint-config-airbnb eslint@^3.9.1 eslint-plugin-jsx-a11y@^2.2.3 eslint-plugin-import@^2.1.0 eslint-plugin
-react@^6.6.0 --dev

@angular/core

Angular also requires a few peer dependencies.

install-peerdeps @angular/core should do the trick.

What if you want to try a beta version? Run install-peerdeps @angular/core@next.

This tool will automatically install the version corresponding to the tag, as well as its peer dependencies:

...
Installing peerdeps for @angular/core@4.0.0-beta.1.
yarn add @angular/core rxjs@^5.0.1 zone.js@^0.7.2

yarn add v0.18.1
...

License

MIT

Keywords

FAQs

Package last updated on 29 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc