I am using django-pipeline-browserify to bridge django-pipeline and browserify. However, I am not able to collectstatic without the following error. And I am able to manually compile the js file by copying the command showed in the error message. Therefore, I have no idea what have I done wrong here.
You have requested to collect static files at the destination
location as specified in your settings:
/var/www/anime/static
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
matching file: animelist/css/style.css
Post-processed 'animelist/css/animelist_css.css' as 'animelist/css/animelist_css.css'
matching file: animelist/js/bower_components/jquery/dist/jquery.min.js
matching file: animelist/js/bower_components/react/react-with-addons.js
matching file: animelist/js/app.browserify.js
command: /usr/bin/env browserify /var/www/anime/static/animelist/js/app.browserify.js > /var/www/anime/static/animelist/js/app.browserify.browserified.js
Traceback (most recent call last):
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/compilers/__init__.py", line 120, in execute_command
stderr=subprocess.PIPE)
File "/usr/lib64/python3.4/subprocess.py", line 858, in __init__
restore_signals, start_new_session)
File "/usr/lib64/python3.4/subprocess.py", line 1456, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: ' '
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle
collected = self.collect()
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
for original_path, processed_path, processed in processor:
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/storage.py", line 33, in post_process
packager.pack_javascripts(package)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 112, in pack_javascripts
return self.pack(package, self.compressor.compress_js, js_compressed, templates=package.templates, **kwargs)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 105, in pack
paths = self.compile(package.paths, force=True)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 99, in compile
return self.compiler.compile(paths, force=force)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/compilers/__init__.py", line 54, in compile
return list(executor.map(_compile, paths))
File "/usr/lib64/python3.4/concurrent/futures/_base.py", line 549, in result_iterator
yield future.result()
File "/usr/lib64/python3.4/concurrent/futures/_base.py", line 402, in result
return self.__get_result()
File "/usr/lib64/python3.4/concurrent/futures/_base.py", line 354, in __get_result
raise self._exception
File "/usr/lib64/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/compilers/__init__.py", line 42, in _compile
outdated=outdated, force=force)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline_browserify/compiler.py", line 28, in compile_file
return self.execute_command(command, cwd=dirname(infile))
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/compilers/__init__.py", line 135, in execute_command
raise CompilerError(e)
pipeline.exceptions.CompilerError: [Errno 2] No such file or directory: ' '
django-pipeline setting file
# Django Pipeline (and browserify)
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
PIPELINE = {
'PIPELINE_ENABLED' : True,
'COMPILERS' : ('pipeline_browserify.compiler.BrowserifyCompiler', ),
'CSS_COMPRESSOR' : 'pipeline.compressors.NoopCompressor',
'JS_COMPRESSOR' :'pipeline.compressors.uglifyjs.UglifyJSCompressor',
'STYLESHEETS' : {
'animelist_css': {
'source_filenames': ( 'animelist/css/style.css', ),
'output_filename': 'animelist/css/animelist_css.css',
}
},
'JAVASCRIPT': {
'animelist_js': {
'source_filenames': (
'animelist/js/bower_components/jquery/dist/jquery.min.js',
'animelist/js/bower_components/react/JSXTransformer.js',
'animelist/js/bower_components/react/react-with-addons.js',
'animelist/js/app.browserify.js',
),
'output_filename': 'animelist/js/animelist.js',
}
,}
}
if DEBUG:
PIPELINE['BROWSERIFY_ARGUMENTS'] = '-t babelify'
Apparently, this issue is due to django-pipeline-browserify(0.2.0) not being compatible with the latest version of django-pipeline(1.6.x). Therefore, I have made a fork of the original project and updated the code. You may copy and paste the compiler.py from my repo and replace the one installed using pip.
I will be making a new pull request on the original repo soon to get it updated. Hopefully the owner will push it to pip after that asap.