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

"npm install bootstrap@latest" now installs v4 alpha instead of 3.3.6 #18520

Closed
arechsteiner opened this issue Dec 10, 2015 · 11 comments
Closed

Comments

@arechsteiner
Copy link
Contributor

With npm, using

npm install bootstrap --save causes "bootstrap": "~4.0.0-alpha.2" being installed and added as a dependency to package.json.

In bower on the other hand, bower install bootstrap --save installs and saves the latest stable version (3.3.6), as expected.

@arechsteiner arechsteiner changed the title "npm install bootstrap now installs v4 alpha instead of latest stable "npm install bootstrap" now installs v4 alpha instead of latest stable Dec 10, 2015
@cvrebert cvrebert added the meta label Dec 10, 2015
cvrebert added a commit that referenced this issue Dec 10, 2015
Docs: Include major version in `npm install bootstrap` commands
Future-proofing for when Bootstrap v5 eventually exists.
Refs #18520

[ci skip]
@cvrebert
Copy link
Collaborator

Unable to reproduce.

dummy $ npm -v
3.3.12
dummy $ npm install bootstrap
/Users/chris/code/dummy
└── bootstrap@3.3.6 

dummy $

@danielweck
Copy link

I had the same problem (see #18539 )

npm view bootstrap dist-tags (alternatively npm dist-tag ls bootstrap) shows { latest: '4.0.0-alpha.2' }
I'm pretty sure "latest" should reference the stable version 3.x (Git master branch), not 4.x which is a pre-release (branch v4-dev) Don't you think?

That's how other NPM libs do it, e.g. jQuery:

$ npm view jquery dist-tags

{ beta: '3.0.0-alpha1',
  latest: '2.1.4',
  old: '1.9.1',
  compat: '1.11.3' }

@danielweck
Copy link

See NPM documentation: https://docs.npmjs.com/cli/dist-tag
"latest" should be used for current v3 version, "alpha" or "beta" for v4

@cvrebert
Copy link
Collaborator

Wow, the npm docs don't surface this too well. And googling for "npm prerelease" didn't seem to yield anything mentioning dist-tags either.

@cvrebert
Copy link
Collaborator

@danielweck Still confused why you were getting v4 though. The webpages I had found regarding prereleases claim that npm install <packagename> skips prereleases (such as our alphas). Did you use some different installation command?

@cvrebert
Copy link
Collaborator

The dist-tags should be sorted out now:

$ npm view bootstrap dist-tags
{ latest: '3.3.6', next: '4.0.0-alpha.2' }

@danielweck
Copy link

@cvrebert I am not sure about the original issue committer ( @arechsteiner ), but personally I was using npm install bootstrap@latest which explains why v4 was pulled instead of v3. Thanks for fixing the dist-tags :)

@arechsteiner
Copy link
Contributor Author

@danielweck: I am using npm install bootstrap, without the @latest.

@cvrebert: This works now, and npm view dist-tags bootstrap shows { latest: '3.3.6', next: '4.0.0-alpha.2' }. 3.3.6 is installed as expected.

@cvrebert cvrebert changed the title "npm install bootstrap" now installs v4 alpha instead of latest stable "npm install bootstrap@latest" now installs v4 alpha instead of 3.3.6 Dec 11, 2015
@cvrebert
Copy link
Collaborator

And I've just sent a PR to update our internal npm release instructions accordingly, so this should be fully resolved now.
@danielweck Thank you for the dist-tags pointer.

@boennemann
Copy link

@cvrebert I really appreciate your documentation efforts for dist-tags. I did a full write-up on dist-tags recently: https://medium.com/greenkeeper-blog/one-simple-trick-for-javascript-package-maintainers-to-avoid-breaking-their-user-s-software-and-to-6edf06dc5617
Using this technique you might be able to avoid the confusion around prerelease versions altogether.

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

No branches or pull requests

4 participants