简体   繁体   English

Bower不安装组件

[英]Bower does not install components

I have been using bower locally to manage JavaScript dependencies for a project I am working on. 我一直在本地使用bower来管理我正在处理的项目的JavaScript依赖项。 Typically, everything works just fine. 通常情况下,一切正常。

However, today, I tried to start a new project using some code from previous projects. 但是,今天,我尝试使用以前项目中的一些代码启动一个新项目。 Namely, using the previous component.json and .bowerrc files: 即,使用以前的component.json.bowerrc文件:

// .bowerrc
{
  "directory": "src/static/js/lib"
}

//component.json
{
  "name": "backbone-project",
  "version": "0.0.0",
  "dependencies": {
    "backbone": "~0.9.10",
    "underscore": "~1.4.3",
    "jasmine": "~1.3.1",
    "jasmine-jstd-adapter": "~1.1.2",
  }
}

However, when I try to run bower install , I just get a generic error: 但是,当我尝试运行bower install ,我只是得到一个通用错误:

± % bower install
bower error

I have run mkdir -p src/static/js/lib to ensure that the folders exist, and this works in other projects that I have done. 我已经运行了mkdir -p src/static/js/lib来确保文件夹存在,这适用于我已经完成的其他项目。

Why is it that bower isn't installing dependencies? 为什么凉亭没有安装依赖? How can I get more information about this error? 如何获得有关此错误的更多信息?

Your component.json is invalid. 您的component.json无效。 Notice the dangling comma "jasmine-jstd-adapter": "~1.1.2", , which is not allowed in JSON. 注意悬空逗号"jasmine-jstd-adapter": "~1.1.2", ,这在JSON中是不允许的。

This silent death also happens if there is a blank version number. 如果有空白版本号,也会发生这种无声死亡。

See these related issues: Using an invalid version value in bower.json silently fails and bower install doesn't generate the components directory . 请参阅以下相关问题: 在bower.json中使用无效版本值会无提示失败,并且bower install不会生成组件目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM