Run bower from root user, it’s possible? How?

below answer is for symfony framework’s bundle,
but if you come here from google using phrase “bower root” you have two options to solve that:

  1. add –allow-root to command
  2. set global bower config that will allow
    running bower as root

Option 1: you can run bower as root by typing:

bower install --allow-root

root is allowed by setting –allow-root command parameter

Option 2: is using global setting that allows root, by creating file:
/root/.bowerrc
which have inside following configuration:

{ "allow_root": true }

how to do this in SpBowerBundle symfony bundle:
probably you haven’t set sp_bower.allow_root to true in SpBowerBundle config

in bundle config, by default you have set something like this:

allow_root: false # optional

but you should have:

allow_root: true

so in app/config/config.yml add this bundle config

sp_bower:
    allow_root: false # optional

bundle config reference (all settings):
https://github.com/Spea/SpBowerBundle/blob/master/Resources/doc/configuration_reference.md

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)