-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
doesn't use newer tagged version if package-lock.json contains older version of the package
#3755
Comments
7.24.0 still don't work. |
This is due to the nature of tags and the package-lock. When you install
The version itself is what is in the lockfile. This is because a tag is not idempotent, it can change. It has to be looked up at install time. When you run a bare The solution is that if you are using tags in your package.json, and you have a lockfile, you need to The same issue happens with git tags and you can read my comment there which explains this from the perspective of git dependencies. |
can we get some flag for npm install that would also lookup and update tags ? it was working like that in npm 6 |
Is there an existing issue for this?
Current Behavior
I have added a dependency to my package.json and specified a version by tag, like this:
Then after some time I've changed the tag to newer version, like this:
at this point, the package-lock.json has reference to older version. If I run
npm install
with npm@6 the package-lock.json gets updated with latest versions.however, if I do the same on the system with npm@7, the package-lock.json gets migrated to version=2, but dependencies remains the same as before, so my application still references older versions of dependent packages.
Expected Behavior
I expect that npm@7 will respect the tagged version in the package.json if there is a mismatch between package.json and package-lock.json.
at least, based on comments of @zkat here it is expected behaviour of
npm install
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: