2016-07-26 181 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