[BUG] npm install silently fails to install peer dependency #6071
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 8.x
work is associated with a specific npm 8 release
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm doesn't install peer dependency @mdx-js/react without any error or even warning. Warning is printed out only after installation when using npm ci and and in such case @mdx-js/react is also not installed:
This happens because npm installs the latest version of React instead version required by dependencies. Such behaviour can be avoided by adding required version of React within package.json. The only reference to a new version of React I found is in library @figspec/react in devDependencies what shouldn't impact.
This issue can be reproduced with the following versions of npm: 8.19.2, 8.19.3, 9.2.0.
package.zip
Expected Behavior
npm should not install the latest version of React but one which is required by dependencies or npm should throw an error when library is not installed.
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: