爆米花没有注入你的档案

spe*_*0ne 4 javascript popcornjs angularjs yeoman bower

在进行grunt(咕噜声)时,我得到了:

Running "bower-install:app" (bower-install) task

popcornjs was not injected in your file.
Please go take a look in "app\bower_components\popcornjs" for the file you need, then manually include it in your file.
Run Code Online (Sandbox Code Playgroud)

我已将Popcorn.js添加到bower.json:

{
    "name": "NAME",
    "version": "0.0.0",
    "dependencies": {
        "angular": "1.2.6",
        .
        "popcornjs": "~1.3.0",
        .
        "angular-slugify": "1.0.0"
    },
    "devDependencies": {
        "angular-mocks": "1.2.6",
        "angular-scenario": "1.2.6"
    }
}
Run Code Online (Sandbox Code Playgroud)

至于我的index.html:

<s_cript src="bower_components/popcornjs/popcorn.js"></script>
<s_cript src="bower_components/popcornjs/modules/player/popcorn.player.js"></script>
<s_cript src="bower_components/popcornjs/players/youtube/popcorn.youtube.js"></script>
<s_cript src="bower_components/popcornjs/plugins/code/popcorn.code.js"></script>
Run Code Online (Sandbox Code Playgroud)

. ''

我错过了什么吗?其他图书馆工作正常.

Ste*_*hen 7

我只是快速搜索了一下popcornjs.当你说的时候你回来的回购bower install --save popcornjshttps://github.com/mozilla/popcorn-js/.该repo有一个bower.json文件,该文件中有一个main属性.该属性告诉grunt-bower-install您要在HTML中注入哪个文件.

但是,您正在使用版本~1.3.0,这将删除此:https://github.com/mozilla/popcorn-js/tree/v1.3.0.那没有bower.json,因此grunt-bower-install无法知道要包含哪个文件.

解决方案是手动将其包含在HTML中,或升级到正确使用Bower的较新版本.