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

Package.json with dependencies "latest" does not download latest #1204

Closed
MadhuriGurumurthy11 opened this issue Apr 24, 2020 · 3 comments
Closed

Comments

@MadhuriGurumurthy11
Copy link

npm version: 3.10.10
Scenario: I uploaded a jar to my private npm repo with version 1.2.0. Now for some reason, I added a new jar with version 1.1.0.
My package.json has a dependency "XYZ": "latest". But it downloads 1.1.0? Is this a bug or I am doing something not right? I was expecting it to download 1.2.0 always.

@MadhuriGurumurthy11 MadhuriGurumurthy11 changed the title Package.json with dependencies "lates" does not download latest Package.json with dependencies "latest" does not download latest Apr 24, 2020
@ljharb
Copy link
Collaborator

ljharb commented Apr 24, 2020

what's a jar? npm deals in tarballs.

"latest" is a dist-tag; a version has to be explicitly set to it. When backporting (as you've done), it's easy to accidentally set the older version as "latest".

I'd suggest using https://npmjs.com/safe-publish-latest to avoid this in the future; to fix this now, run npm dist-tag add $pkg@1.2.0 latest

@MadhuriGurumurthy11
Copy link
Author

Sorry my bad, I meant tarballs (and not jars).

@MadhuriGurumurthy11
Copy link
Author

That solution works. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants