Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor-Bootstrap jQuery wrong version

I do have the following message in the console:

Uncaught Error: Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v3.0.0

In .meteor > version file it says it's [email protected].

  • I did tried to meteor remove and the install again both jquery and boostrap separately.
  • Also tried to manualy change current version in .meteor version file to 1.9.1 first in terminal it says:
    jquery upgraded from 1.9.1 to 1.11.9
    But after server restart the current version is back to 1.11.9

What can be done to retrieve the favor of the javascript gods?

like image 826
volna Avatar asked Aug 01 '16 21:08

volna


2 Answers

This may happen when you have other npm packages with jQuery dependency defined as >= 1.9.1

In that case, if no other package defines a more strict version, npm will automatically take the most recent version that complies with this dependency specification, i.e. jQuery 3+ in that case.

If you are in that situation, a simple workaround is to add a more strict version specification in your package.json file, e.g. "jquery": ">=1.9.1 <3.0.0"

like image 153
ghybs Avatar answered Sep 28 '22 04:09

ghybs


A few google searches got me here: https://forums.meteor.com/t/meteor-and-bootstrap-doesnt-work-error-bootstraps-javascript-requires-jquery/15597/8

What it says is:

  1. Add the jquery package back in: meteor add jquery

  2. Remove bootstrap everywhere you have it (all locations - so completely remove the bootstrap directory in your project root, remove it from the js directory in your project root, and remove it from your client/lib directory).

  3. Remove jquery everywhere you have it (all locations - so remove it from your client/lib directory and your js directory).

  4. Remove the references to Bootstrap and jQuery in your index.html - so completely remove: <script type="text/javascript" src="client/lib/a_jquery-1.11.1.min.js"></script> <script type="text/javascript" src="client/lib/bootstrap.min.js"></script>

What happens when you follow those steps?

like image 25
Sanderfish Avatar answered Sep 28 '22 04:09

Sanderfish