npm / npm/cli

[BUG] Questions about recursion rely on * version

Open
#5,823 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

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

hi,I'm using npm v8.5.0.

My project, there are two depend on two dependencies package, for example, "aang.haoyu-npm-install-test-a" and
"wang.haoyu-npm-install-test-b" respectively.

The "aang.haoyu-npm-install-test-a" package has dependencies is ""vue": "*"".

The "wang.haoyu-npm-install-test-b" package has dependencies is ""vue": "2.0.0"".

when i run npm install in my project, I found the top-level vue node_modules version is 3.2.41 (latest), I guess this is caused by *.

but i think the * will follow the vue version of other "wang.haoyu-npm-install-test-b",It should be vue@2.0.0,Not the latest.

Expected Behavior

Expect * follow project recursive depend on not the latest.

Steps To Reproduce
  1. in this project: https://github.com/19Qingfeng/npm-bug-report
  2. run npm install
  3. you can see node_modules
Environment
  • npm:8.5.0
  • Node.js:16.14.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running npm install in the linked reproduction project and inspect its package manifests and resulting node_modules versions. Compare the resolution of vue@* with the transitive vue@2.0.0 dependency; done means the dependency resolution behavior is confirmed and matches the documented or intended semver rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.