2016-07-26 153 views
0

我试图通过NPM,但没有安装亭子当我运行此命令为根happend:凉亭不能安装依赖

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 

[email protected] /usr/lib/node_modules/npm 

任何想法?

回答

1

它是:npm install -g bower。在你的情况下,你可以用sudo作为前言。

编辑:您看到npm输出的原因是因为您试图运行'bower'作为npm命令('bower'不是npm命令),而不是使用bower作为选项运行'install' 。

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

+0

@Bobox - 请勾选此为所选答案。 (: – CryptoPiggy

+0

我已经使用sudo相同的消息 – Bobox

+0

是的,但你的命令是不一样的,这样做:'sudo npm install -g bower'(复制并粘贴) – CryptoPiggy