我正在尝试通过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
有什么想法吗?
答案 0 :(得分:1)
是npm install -g bower
。在您的情况下,您可以使用sudo
开头。
编辑:您看到npm输出的原因是因为您正在尝试运行&#39; bower&#39;作为npm命令(&#39; bower&#39;不是npm命令),而不是运行&#39; install&#39;用凉亭作为选择。
要从bower.json
安装依赖项,请转到项目文件夹并运行bower install
。