Bower throws jquery "not injected" warning after grunt starts

Recently, I had to clone a project and rebuild packages for divers. jQuery updated, I believe, and now gives a warning:

Attention:
  Please go take a look in "app/bower_components/jquery" for the file you need, then manually include it in your file.

I have done it. And everything works correctly. However, every time I grunt servestill get a warning?

jquery was not injected in your file.

How to remove this error? and will this error fail? I am sure that the warning is harmless, but it is really frustrating to see it.

main.bower.json

{
  "name": "jordan",
  "version": "0.0.0",
  "dependencies": {
    "angular": "1.2.6",
    "json3": "~3.2.6",
    "es5-shim": "~2.1.0",
    "angular-resource": "1.2.6",
    "angular-cookies": "1.2.6",
    "angular-sanitize": "1.2.6",
    "angular-route": "1.2.6",
    "jquery-ui": "~1.10.3"
  },
  "devDependencies": {
    "angular-mocks": "1.2.6",
    "angular-scenario": "1.2.6"
  }
}

enter image description here

.bower.json for jquery

{
  "name": "jquery",
  "version": "2.1.0",
  "ignore": [
    "**/.*",
    "build",
    "speed",
    "test",
    "*.md",
    "AUTHORS.txt",
    "Gruntfile.js",
    "package.json",
    "bower.json"
  ],
  "dependencies": {
    "sizzle": "1.10.16"
  },
  "devDependencies": {
    "requirejs": "~2.1.8",
    "qunit": "~1.12.0",
    "sinon": "~1.7.3"
  },
  "keywords": [
    "jquery",
    "javascript",
    "library"
  ],
  "homepage": "https://github.com/jquery/jquery",
  "_release": "2.1.0",
  "_resolution": {
    "type": "version",
    "tag": "2.1.0",
    "commit": "cac43f3ef791b7e68c1917a734fb92e04450c111"
  },
  "_source": "git://github.com/jquery/jquery.git",
  "_target": ">=1.6",
  "_originalSource": "jquery"
}
+3
source share
3 answers

You can solve this problem by changing the bower.json of your project and override the package with the problem

"overrides": {
  "jquery": {
    "main": "./dist/jquery.js"
  }
}

https://github.com/bower/bower/issues/585

, , JQuery Bower.

+12

Github: https://github.com/stephenplusplus/grunt-bower-install/issues/55

grunt-bower-install - , , jQuery, Bower. , Bower, . , , , HTML , ,

, : (

+4

In general, if you get this error, this is because the author of any bower component that you use did not include the bower.json file in the component or did not define the "main" property in the gazebo. json If the component is actively supported, you should open the github question, requiring you to create the appropriate bower.json file in the component. Here is an example of the real world ...

https://github.com/CreateJS/SoundJS/issues/76

0
source

All Articles