django-bower icon indicating copy to clipboard operation
django-bower copied to clipboard

Error when arguments are passed to `manage.py bower install`

Open mik3y opened this issue 9 years ago • 11 comments

This looks to be a bug in management/commands/bower.py; BaseBowerCommand._install is only used when there are no arguments.

# myapp/settings.py

BOWER_INSTALLED_APPS = (
    'jquery',
)
$ python manage.py bower install
bower jquery#*                  cached git://github.com/jquery/jquery.git#2.1.4
bower jquery#*                validate 2.1.4 against git://github.com/jquery/jquery.git#*
bower jquery#>=1.2              cached git://github.com/jquery/jquery.git#2.1.4
bower jquery#>=1.2            validate 2.1.4 against git://github.com/jquery/jquery.git#>=1.2
bower jquery#>=1.6              cached git://github.com/jquery/jquery.git#2.1.4
bower jquery#>=1.6            validate 2.1.4 against git://github.com/jquery/jquery.git#>=1.6
$ python manage.py bower install -- --allow-root
bower                           ENOENT No bower.json present

mik3y avatar Jun 06 '15 17:06 mik3y

I'm experiencing the same issue.

aboudreault avatar Jun 24 '15 15:06 aboudreault

@mik3y Do you know a workaround for now by chance?

aboudreault avatar Jul 01 '15 15:07 aboudreault

Same issue for me.

cteplovs avatar Jul 14 '15 16:07 cteplovs

For the moment, I think I will simply create a bower.json and run bower manually.... might remove that django-bower in the next months though.

aboudreault avatar Jul 15 '15 17:07 aboudreault

@mik3y I'm having the same problem. Is there any status on this?

athai avatar Jul 16 '15 21:07 athai

@nvbn This whole thing (passing flags to bower with -- --flag-name is documented, but doesn't seem to be working? Was there a time that it was working and eventually broke?

pop avatar Jul 16 '15 23:07 pop

Ran into the same problem, and switching my command fixed the issue:

./manage.py bower_install -- --allow-root --no-input works

whereas ./manage.py bower install -- --allow-root --no-input does not work.

(note the underscored bower_install in the working version)

I see there's a few Issues discussing the confusion between these commands: #17 and #44

pydolan avatar Aug 19 '15 21:08 pydolan

yeah, bower_install. Thanks @pydolan

aboudreault avatar Aug 20 '15 13:08 aboudreault

using bower_install worked for me as well.

caleb-allen avatar Mar 09 '16 22:03 caleb-allen

not working:

bower ESUDO Cannot be run with sudo

aj07mm avatar Mar 27 '16 02:03 aj07mm

python manage.py bower_install --allow-root worked for me. In addition, I used BOWER_COMPONENTS_ROOT = os.path.join(str(ROOT_DIR('project_name')), 'static', 'components') to save the files in project_name/static/components.

Hope that helps.

oesah avatar Oct 19 '16 16:10 oesah