【发布时间】:2014-09-04 18:45:11
【问题描述】:
我有一个本地开发服务器,我在其中测试了很多东西,现在我正在使用 bower 来管理 Symfony2 项目中库的依赖项。在安装 NodeJS (v0.10.31) 和 bower (1.3.9) 后,我尝试从控制台以 root 运行属于 Symfony2 SpBowerBundle 的命令 sp:bower:install:
Symfony > sp:bower:install
Installing bower dependencies for "TemplateBundle" into "/var/www/html/tanane/src/Tanane/TemplateBundle/Resources/config/bower/../../public/components"
bower ESUDO Cannot be run with sudo
Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.
http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814
You can however run a command with sudo using --allow-root option
我知道添加 --allow-root 是有效的,因为我直接从 bash 进行了测试,但显然不允许从 bundle 命令行添加。现在,以 root 运行 bower 以添加 --allow-root 的唯一方法是还是以其他方式存在?
【问题讨论】:
-
echo '{ "allow_root": true }' > /root/.bowerrc