linux - Bower 输出为 JSON 格式

标签 linux ubuntu npm bower

每次使用 Bower 工具时,我都会得到 json 格式的输出。

例如:

** bower 帮助**

控制台输出:

{
  "usage": [
    "<command> [<args>] [<options>]"
  ],
  "commands": {
    "cache": "Manage bower cache",
    "help": "Display help information about Bower",
    "home": "Opens a package homepage into your favorite browser",
    "info": "Info of a particular package",
    "init": "Interactively create a bower.json file",
    "install": "Install a package locally",
    "link": "Symlink a package folder",
    "list": "List local packages - and possible updates",
    "login": "Authenticate with GitHub and store credentials",
    "lookup": "Look up a package URL by name",
    "prune": "Removes local extraneous packages",
    "register": "Register a package",
    "search": "Search for a package by name",
    "update": "Update a local package",
    "uninstall": "Remove a local package",
    "unregister": "Remove a package from the registry",
    "version": "Bump a package version"
  },
  "options": [
    {
      "shorthand": "-f",
      "flag": "--force",
      "description": "Makes various commands more forceful"
    },
    {
      "shorthand": "-j",
      "flag": "--json",
      "description": "Output consumable JSON"
    },
    {
      "shorthand": "-l",
      "flag": "--loglevel",
      "description": "What level of logs to report"
    },
    {
      "shorthand": "-o",
      "flag": "--offline",
      "description": "Do not hit the network"
    },
    {
      "shorthand": "-q",
      "flag": "--quiet",
      "description": "Only output important information"
    },
    {
      "shorthand": "-s",
      "flag": "--silent",
      "description": "Do not output anything, besides errors"
    },
    {
      "shorthand": "-V",
      "flag": "--verbose",
      "description": "Makes output more verbose"
    },
    {
      "flag": "--allow-root",
      "description": "Allows running commands as root"
    },
    {
      "shorthand": "-v",
      "flag": "--version",
      "description": "Output Bower version"
    },
    {
      "flag": "--no-color",
      "description": "Disable colors"
    }
  ]
}

但结果应该是这样的 https://theenlighteneddeveloper.files.wordpress.com/2013/12/capture-d_c3a9cran-2013-12-08-c3a0-22-32-47.png

每个 bower 命令都会出现这个问题。

Bower 版本:1.7.9 NPM 版本:1.3.10 Ubuntu 14.04

有人知道如何改变人类更愉快的格式吗?

提前致谢

最佳答案

在版本 1.7.9 中引入了一些变化。

我的 .bowerrc 看起来像:

{
    "directory": "bower_components",
    "json": "bower.json"
}

我删除了 "json": "bower.json" 行并解决了问题。

关于linux - Bower 输出为 JSON 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36814529/

相关文章:

java获取硬盘串口

php - Laravel Homestead 'apt-get update' 给出一些 404

linux - 无法打开授权,权限被拒绝

javascript - 无服务器项目如何设置版本?

c++ - 我如何告诉当前或即将在 poll() 中阻塞的线程执行某些操作?

PHP 邮件功能从服务器发送但不是从 php

regex - 如何计算同一正则表达式的每个不同匹配项的出现次数

c++ - 蓝牙连接失败

npm - 重击 : webpack: command not found

azure - 尝试安装 'npm' 时的 LUIS 应用程序 : "Kudu Sync" is not recognized as an internal or external command,