From dfb7fa7619345c1da4c1e3b6728fe31eb61aceab Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 18 Sep 2014 01:46:13 -0400 Subject: [PATCH] Allow bower to install with sudo Without `--allow-root`, bower throws the following: ``` 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 ``` --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 9dccd7a..2ac9041 100755 --- a/install.sh +++ b/install.sh @@ -43,7 +43,7 @@ libffi-dev nodejs libyaml-dev # Install frontend assets sudo npm install -g bower -sudo -iu ${APP_USER} bower --config.cwd=${APP_DIR} --config.directory=realms/static/vendor --config.interactive=false install +sudo -iu ${APP_USER} bower --allow-root --config.cwd=${APP_DIR} --config.directory=realms/static/vendor --config.interactive=false install sudo -iu ${APP_USER} virtualenv ${APP_DIR}/.venv @@ -63,4 +63,4 @@ start on runlevel [2345] stop on runlevel [!2345] respawn exec /usr/local/bin/realms-wiki run -EOF \ No newline at end of file +EOF