我无法在 Ubuntu 12.04 中使用 bower 安装 npm。
npm install -g bower
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'bower' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 3.5.0-54-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /home/rails-dev/my_projects/searchinmena
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/rails-dev/my_projects/searchinmena/npm-debug.log
npm ERR! not ok code 0
有人能帮忙吗,我该如何安装它。
答案1
也许你需要节点(依赖于 bower 工作),请验证:
node -v
如果尚未安装,请使用以下命令安装节点:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
然后尝试以管理员权限使用 NPM 安装 bower:
sudo npm install -g bower