Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm install silently fails to install peer dependency #6071

Open
2 tasks done
krzepa opened this issue Jan 20, 2023 · 0 comments
Open
2 tasks done

[BUG] npm install silently fails to install peer dependency #6071

krzepa opened this issue Jan 20, 2023 · 0 comments
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

Comments

@krzepa
Copy link

krzepa commented Jan 20, 2023

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

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:
image
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

  1. In this environment with the latest version of node and npm
  2. With this attached package.json
  3. Run 'npm i'
  4. See node_modules and look for @mdx-js/react
  5. Run 'npm ci'
  6. See warning mesages about problems with resolving dependencies with @mdx-js/react
  7. See node_modules and look for @mdx-js/react

Environment

  • npm: 9.2.0
  • Node.js: 19.4.0
  • OS Name: Microsoft Windows [Version 10.0.19044.2486]
  • System Model Name: Asus G551JM
  • npm config:
; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrc

prefix = "C:\\Users\\Radosław\\AppData\\Roaming\\npm"

; "cli" config from command line options

location = "project"

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v19.4.0
; npm local prefix = C:\_projects\test-npm
; npm version = 9.2.0
; cwd = C:\_projects\test-npm
; HOME = C:\Users\Radosław
; Run `npm config ls -l` to show all defaults.
@krzepa krzepa added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant