-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
Expected behavior
When using react-intl and not prop-types, not get a warning from yarn
.
Current behavior
Running yarn
gives the following warning:
warning " > react-intl@2.9.0" has unmet peer dependency "prop-types@^15.5.4".
Step to reproduce for BUG REPORT
$ cat >package.json <<EOF
{
"name": "hello",
"version": "0.1.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"react": "16.8.6",
"react-intl": "2.9.0"
}
}
EOF
$ yarn
yarn install v1.17.3
info No lockfile found.
[1/4] Resolving packages...
warning react-intl > intl-relativeformat@2.2.0: This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide'
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > react-intl@2.9.0" has unmet peer dependency "prop-types@^15.5.4".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 0.61s.
Your Environment
Executable | Version |
---|---|
npm ls react-intl |
2.9.0 |
npm ls react |
26.8.6 |
yarn --version |
1.17.3 |
node --version |
10.15.2 |
Discussion
This is a re-opening of #1054, which was closed by stale-bot.
This situation isn't the kind a peerDependency
is for. See this 2018 blog post for a clearer explanation of peer dependencies than most:
https://yarnpkg.com/blog/2018/04/18/dependencies-done-right/
Or this older, longer one:
https://nodejs.org/en/blog/npm/peer-dependencies/
React Intl isn't in any sense a plugin for prop-types
; it doesn't expect that I'll necessarily be require
-ing prop-types
from my code at all. So it shouldn't have prop-types
as a peer dependency.
Metadata
Metadata
Assignees
Labels
No labels