Looking through the documentation I see -S
, -O
, -D
etc. options for installing dependencies, but I don't see a flag for installing to the peer dependency block.
Does NPM have a flag for installing to peer dependencies?
Looking through the documentation I see -S
, -O
, -D
etc. options for installing dependencies, but I don't see a flag for installing to the peer dependency block.
Does NPM have a flag for installing to peer dependencies?
Per https://blog.npmjs.org/post/110924823920/npm-weekly-5,
Peer dependencies won't be automatically installed and you must install them manually.
If you want to save peer dependencies for your project, install with the --peer flag.
No, there is no CLI flag to install as a peer dependency.
You will need to manually edit package.json
to add a property peerDependencies
.
{
"name": "my-package",
"version": "1.0.0",
"peerDependencies": {
"cuid": "^2.1.0"
}
}