linux - DataTables bower 更新错误(多平台)

标签 linux windows datatables bower

这不会发生在我们使用 Mac 的同事身上,但我的另一位使用 Windows 的同事最近也遇到过。我们有 bower 来处理我们应用程序中的 JS 库,而且当我bower update 时,我经常面临:

λ bower update
bower                       EMALFORMED Failed to read C:\Users\uname\Documents\repo\bower\DataTables\.bower.json
Additional error details:
Unexpected token }

(我正在使用 Cmder,这是 λ 提示符)。 计算机总是正确的,如果我导航到引用的文件,它的末尾明显有第二个右大括号。

{
  "name": "datatables",
  "main": [
    "media/js/jquery.dataTables.js",
    "media/css/jquery.dataTables.css",
    "media/images/sort_asc.png",
    "media/images/sort_asc_disabled.png",
    "media/images/sort_both.png",
    "media/images/sort_desc.png",
    "media/images/sort_desc_disabled.png"
  ],
  "dependencies": {
    "jquery": ">=1.7.0"
  },
  "license": "MIT",
  "keywords": [
    "jquery",
    "datatables",
    "table",
    "javascript",
    "library"
  ],
  "ignore": [
    "/.*",
    "examples",
    "media/unit_testing",
    "composer.json",
    "dataTables.jquery.json",
    "package.json"
  ],
  "homepage": "https://github.com/DataTables/DataTables",
  "version": "1.10.11",
  "_release": "1.10.11",
  "_resolution": {
    "type": "version",
    "tag": "1.10.11",
    "commit": "8a3412a1aee8fdb4b65f426faa6c9a986994abfe"
  },
  "_source": "git://github.com/DataTables/DataTables.git",
  "_target": "~1.10.11",
  "_originalSource": "DataTables"
}}

我怎样才能避免这种情况?是什么原因造成的?我假设这个以句点开头的 bower.json 来自服务器或中间构建步骤的结果。我想找到根本原因,这样就不会再发生了。如果我手动移除多余的花括号,Bower 构建就会成功,但我必须经常这样做。或者这是 DataTables + Windows + bower 的问题?


更新:在 Windows(Win 10 64 位)上仍然有问题,我现在在 Linux 上也有:

Bower version: 1.7.7
Node version: 0.10.25
OS: Linux 4.4.0-x86_64-linode63 x64
(env)user@server:/opt/webapps/sportsboard/env/westshoretech$ bower update --force
bower                       EMALFORMED Failed to read /opt/webapps/blabla/env/product/bower/DataTables/.bower.json

Additional error details:
Unexpected end of input

最佳答案

我遇到了类似的问题,解决方案是将 bower 依赖项的名称从“datatables”更改为“datatables.net”,这是 docs 中列出的名称.

关于linux - DataTables bower 更新错误(多平台),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35907035/

相关文章:

linux - 错误 : Lapack library not found in compile time (zerobrane, lua,手电筒)

c++ - Linux 共享库中的单例无法按预期工作

c - 从命令行使用 sizeof 编译 C 代码时出错

python - IOError : [Errno 13] Permission denied, 打开文件时

ruby-on-rails - 如何使用 Arel 跨多态 has_one 关系进行查询

jquery - 如何将消息添加到数据表分页行

可以列出给定路径内的文件和文件夹的 Linux 内核模块

c - 如何在 Windows 上获取磁盘标识符?

windows - 原始打印直接到 USB 打印机,绕过 Windows 后台处理程序

datatables - 在Angular 5数据表: cannot reinitialise DataTable中遇到错误