编程语言
首页 > 编程语言> > javascript – 爆米花没有注入你的文件

javascript – 爆米花没有注入你的文件

作者:互联网

在进行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.

我已将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"
    }
}

至于我的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>

. ”

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

解决方法:

我刚刚对popcornjs进行了快速搜索.当你说凉亭安装时,你拉出的仓库–save popcornjs是https://github.com/mozilla/popcorn-js/.那个仓库有一个bower.json文件,那个文件里面有一个主要属性.该属性告诉grunt-bower-install要在HTML中注入哪个文件.

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

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

标签:javascript,angularjs,bower,yeoman,popcornjs
来源: https://codeday.me/bug/20190612/1226283.html