我有一个本地开发服务器,用于测试很多东西,现在我正在尝试使用bower来管理我的Symfony2项目中的库依赖。安装NodeJS(v0.10.31)和bower(1.3.9)后,我尝试使用命令sp:bower:install
来执行Symfony2 SpBowerBundle中的控制台命令root
:
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
- Jinna Balu