fix: add better peer dep error hints (#4875)

ref https://stackoverflow.com/q/72468635/537682
This commit is contained in:
Zoltan Kochan
2022-06-10 14:40:07 +03:00
committed by GitHub
parent d5730ba815
commit 9b7941c81b
2 changed files with 8 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/default-reporter": patch
"pnpm": patch
---
Add better hints to the peer dependency issue errors.

View File

@@ -400,9 +400,9 @@ function reportPeerDependencyIssuesError (
const hasMissingPeers = getHasMissingPeers(msg.issuesByProjects)
const hints: string[] = []
if (hasMissingPeers) {
hints.push('If you want peer dependencies to be automatically installed, set the "auto-install-peers" setting to "true".')
hints.push('If you want peer dependencies to be automatically installed, add "auto-install-peers=true" to an .npmrc file at the root of your project.')
}
hints.push('If you don\'t want pnpm to fail on peer dependency issues, set the "strict-peer-dependencies" setting to "false".')
hints.push('If you don\'t want pnpm to fail on peer dependency issues, add "strict-peer-dependencies=false" to an .npmrc file at the root of your project.')
return {
title: err.message,
body: `${renderPeerIssues(msg.issuesByProjects)}