【问题标题】:bower can't install dependenciesbower 无法安装依赖项
【发布时间】:2016-07-26 09:29:03
【问题描述】:

我正在尝试通过 npm 安装 bower,但是当我以 root 身份运行此命令时没有发生任何事情:

sudo npm  bower -g install

我在我的控制台中得到了这个:

用法:npm

where <command> is one of:
    access, adduser, bin, bugs, c, cache, completion, config,
    ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
    help, help-search, i, init, install, install-test, it, link,
    list, ln, logout, ls, outdated, owner, pack, ping, prefix,
    prune, publish, rb, rebuild, repo, restart, root, run,
    run-script, s, se, search, set, shrinkwrap, star, stars,
    start, stop, t, tag, team, test, tst, un, uninstall,
    unpublish, unstar, up, update, v, version, view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    /home/achraf/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@3.10.3 /usr/lib/node_modules/npm

有什么想法吗?

【问题讨论】:

    标签: npm bower npm-install bower-install


    【解决方案1】:

    它是:npm install -g bower。在您的情况下,您可以在前面加上sudo

    编辑:您看到 npm 输出的原因是因为您尝试将“bower”作为 npm 命令运行(“bower”不是 npm 命令),而不是使用 bower 作为选项运行“安装”。

    要从bower.json 安装依赖项,请转到您的项目文件夹并运行bower install

    【讨论】:

    • @Bobox - 请“勾选”这个作为选择的答案。 (:
    • 是的,但是你的命令和我的不一样。这样做:sudo npm install -g bower(复制并粘贴)
    • 已经使用你的命令不起作用我的凉亭没有安装我的依赖项
    • 显示/usr/bin/bower -&gt; /usr/lib/node_modules/bower/bin/bower /usr/lib └── bower@1.7.9
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-26
    • 1970-01-01
    • 2016-02-06
    • 2020-05-26
    • 2021-05-29
    • 2018-09-11
    相关资源
    最近更新 更多