title: NPM Error when adding package as a peer dependency
body: <p>I've 2 projects, where I use the same global components, and I decided to create a private npm package, when I moved my dependencies to peer dependencies it gives errors. I want to install packages without error, and when I try to install the npm package in my projects, I want to install it without npm i --legacy-peer-deps or npm i --force. My package.json file:</p>
  <pre><code>&quot;dependencies&quot;: {
      &quot;react-helmet&quot;: &quot;^6.1.0&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/preset-env&quot;: &quot;^7.14.1&quot;,
      &quot;@babel/preset-react&quot;: &quot;^7.13.13&quot;,
      &quot;@rollup/plugin-babel&quot;: &quot;^5.3.0&quot;,
      &quot;@rollup/plugin-commonjs&quot;: &quot;^19.0.0&quot;,
      &quot;@rollup/plugin-node-resolve&quot;: &quot;^13.0.0&quot;,
      &quot;@semantic-release/commit-analyzer&quot;: &quot;8.0.1&quot;,
      &quot;@semantic-release/git&quot;: &quot;9.0.0&quot;,
      &quot;@semantic-release/github&quot;: &quot;7.2.3&quot;,
      &quot;@semantic-release/npm&quot;: &quot;7.1.3&quot;,
      &quot;@semantic-release/release-notes-generator&quot;: &quot;9.0.2&quot;,
      &quot;@storybook/addon-actions&quot;: &quot;6.2.9&quot;,
      &quot;@storybook/addon-essentials&quot;: &quot;6.2.9&quot;,
      &quot;@storybook/addon-info&quot;: &quot;5.3.21&quot;,
      &quot;@storybook/addon-links&quot;: &quot;6.2.9&quot;,
      &quot;@storybook/addons&quot;: &quot;6.2.9&quot;,
      &quot;@storybook/react&quot;: &quot;6.2.9&quot;,
      &quot;@testing-library/jest-dom&quot;: &quot;5.11.9&quot;,
      &quot;@testing-library/react&quot;: &quot;11.1.0&quot;,
      &quot;@testing-library/user-event&quot;: &quot;12.6.3&quot;,
      &quot;@types/humps&quot;: &quot;2.0.0&quot;,
      &quot;@types/jest&quot;: &quot;26.0.15&quot;,
      &quot;@types/react-dom&quot;: &quot;16.9.8&quot;,
      &quot;@types/react-helmet&quot;: &quot;6.1.1&quot;,
      &quot;@types/react-router-dom&quot;: &quot;5.1.7&quot;,
      &quot;@types/react-window&quot;: &quot;1.8.2&quot;,
      &quot;@types/react-window-infinite-loader&quot;: &quot;1.0.3&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;4.5.0&quot;,
      &quot;@typescript-eslint/parser&quot;: &quot;4.5.0&quot;,
      &quot;eslint&quot;: &quot;7.12.0&quot;,
      &quot;eslint-config-airbnb&quot;: &quot;18.2.0&quot;,
      &quot;eslint-import-resolver-alias&quot;: &quot;1.1.2&quot;,
      &quot;eslint-import-resolver-webpack&quot;: &quot;0.13.0&quot;,
      &quot;eslint-plugin-import&quot;: &quot;2.22.1&quot;,
      &quot;eslint-plugin-import-helpers&quot;: &quot;1.1.0&quot;,
      &quot;eslint-plugin-jest&quot;: &quot;24.1.0&quot;,
      &quot;eslint-plugin-jsx-a11y&quot;: &quot;6.4.0&quot;,
      &quot;eslint-plugin-react&quot;: &quot;7.21.5&quot;,
      &quot;eslint-plugin-react-hooks&quot;: &quot;4.2.0&quot;,
      &quot;file-loader&quot;: &quot;6.1.1&quot;,
      &quot;html-webpack-plugin&quot;: &quot;4.5.0&quot;,
      &quot;jest&quot;: &quot;26.6.1&quot;,
      &quot;prettier&quot;: &quot;2.2.1&quot;,
      &quot;rollup&quot;: &quot;^2.50.4&quot;,
      &quot;rollup-plugin-cleaner&quot;: &quot;^1.0.0&quot;,
      &quot;rollup-plugin-delete&quot;: &quot;^2.0.0&quot;,
      &quot;rollup-plugin-peer-deps-external&quot;: &quot;^2.2.4&quot;,
      &quot;rollup-plugin-svg&quot;: &quot;^2.0.0&quot;,
      &quot;rollup-plugin-typescript2&quot;: &quot;^0.30.0&quot;,
      &quot;semantic-release&quot;: &quot;17.4.2&quot;,
      &quot;size-limit&quot;: &quot;4.10.2&quot;,
      &quot;style-loader&quot;: &quot;2.0.0&quot;,
      &quot;ts-jest&quot;: &quot;26.5.6&quot;,
      &quot;typescript-transform-paths&quot;: &quot;2.2.3&quot;
    },
    &quot;peerDependencies&quot;: {
      &quot;@date-io/date-fns&quot;: &quot;1.3.13&quot;,
      &quot;@hookform/resolvers&quot;: &quot;1.3.0&quot;,
      &quot;@material-ui/core&quot;: &quot;4.11.0&quot;,
      &quot;@material-ui/icons&quot;: &quot;4.11.2&quot;,
      &quot;@material-ui/lab&quot;: &quot;4.0.0-alpha.57&quot;,
      &quot;@material-ui/pickers&quot;: &quot;3.2.10&quot;,
      &quot;@size-limit/preset-small-lib&quot;: &quot;4.10.2&quot;,
      &quot;clsx&quot;: &quot;1.1.1&quot;,
      &quot;date-fns&quot;: &quot;2.17.0&quot;,
      &quot;humps&quot;: &quot;2.0.1&quot;,
      &quot;i18next&quot;: &quot;19.8.7&quot;,
      &quot;keycloak-js&quot;: &quot;^12.0.4&quot;,
      &quot;memoize-one&quot;: &quot;^5.1.1&quot;,
      &quot;notistack&quot;: &quot;^1.0.6&quot;,
      &quot;react&quot;: &quot;&gt;=17.0.1&quot;,
      &quot;react-dom&quot;: &quot;17.0.1&quot;,
      &quot;react-hook-form&quot;: &quot;6.9.6&quot;,
      &quot;react-hotkeys-hook&quot;: &quot;^3.2.1&quot;,
      &quot;react-i18next&quot;: &quot;11.8.5&quot;,
      &quot;react-if&quot;: &quot;^4.0.1&quot;,
      &quot;react-router&quot;: &quot;5.2.0&quot;,
      &quot;react-router-dom&quot;: &quot;5.2.0&quot;,
      &quot;react-virtualized-auto-sizer&quot;: &quot;^1.0.4&quot;,
      &quot;react-window&quot;: &quot;1.8.5&quot;,
      &quot;react-window-infinite-loader&quot;: &quot;^1.0.7&quot;,
      &quot;yup&quot;: &quot;0.29.3&quot;
    }
  </code></pre>
  <p>NPM ERROR:</p>
  <pre><code>npm ERR! code ERESOLVE
  npm ERR! ERESOLVE unable to resolve dependency tree
  npm ERR! 
  npm ERR! While resolving: @picsart/pa-backoffice-shared@1.0.0
  npm ERR! Found: react@17.0.2
  npm ERR! node_modules/react
  npm ERR!   peer react@&quot;&gt;=16.0.0&quot; from the root project
  npm ERR!   peer react@&quot;&gt;=16.3.0&quot; from react-helmet@6.1.0
  npm ERR!   node_modules/react-helmet
  npm ERR!     react-helmet@&quot;^6.1.0&quot; from the root project
  npm ERR! 
  npm ERR! Could not resolve dependency:
  npm ERR! peer react@&quot;^16.8.0&quot; from react-hook-form@6.9.6
  npm ERR! node_modules/react-hook-form
  npm ERR!   peer react-hook-form@&quot;6.9.6&quot; from the root project
  npm ERR!   peer react-hook-form@&quot;&gt;=6.6.0&quot; from @hookform/resolvers@1.3.0
  npm ERR!   node_modules/@hookform/resolvers
  npm ERR!     peer @hookform/resolvers@&quot;1.3.0&quot; from the root project
  npm ERR! 
  npm ERR! Fix the upstream dependency conflict, or retry
  npm ERR! this command with --force, or --legacy-peer-deps
  npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
  npm ERR! 
  npm ERR! See /Users/tikopicsart/.npm/eresolve-report.txt for a full report.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /Users/tikopicsart/.npm/_logs/2021-06-02T07_25_09_846Z-debug.log
  </code></pre>
  <p>How can I resolve it without npm i --legacy-peer-deps or npm i --force.</p>