pnpm Install and Dependencies/Add peer dependency entry

Install for local development and declare the peer dependency in package.json.

Section: Dependency Types

Add peer dependency entry

bash
bash
pnpm add -D react && pnpm pkg set peerDependencies.react='^18.0.0'
Explanation

Install for local development and declare the peer dependency in package.json.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Dependency Types
Add production dependency
Save package to dependencies.
OpenIn sheetbashsame section
Add development dependency
Save package to devDependencies.
OpenIn sheetbashsame section
Add optional dependency
Save package to optionalDependencies.
OpenIn sheetbashsame section
Install package globally
Install a package globally.
OpenIn sheetbashsame section
Install dist-tag
Install a package using a registry dist-tag.
OpenIn sheetbash1 tag match
Clean install from lockfile
Perform a clean install from an existing lockfile.
OpenIn sheetbash1 tag match