I'm trying to add django-pipeline to a dockerized Django 3.1 project. However, when I run collectstatic
I receive the following error:
pipeline.exceptions.CompressorError: b'/usr/bin/env: \xe2\x80\x98node\xe2\x80\x99:
No such file or directory\n'
My settings.py
file includes:
PIPELINE = {
'CSS_COMPRESSOR': 'pipeline.compressors.yuglify.YuglifyCompressor',
'COMPILERS': ('pipeline.compilers.sass.SASSCompiler',),
'YUGLIFY_BINARY': str(BASE_DIR.joinpath('node_modules/.bin', 'yuglify')),
'SASS_BINARY': str(BASE_DIR.joinpath('node_modules/.bin', 'sass')),
'STYLESHEETS': {
'twirlmate': {
'source_filenames': (
'pages/scss/styles.css',
),
'output_filename': 'css/styles.css',
},
},
}
And my package.json
includes:
{
...,
"dependencies": {
"sass": "^1.32.5",
"yuglify": "^2.0.0"
}
}
I have other local Django projects that use pipeline, but not Docker, and they work fine, so I'm wondering if it has to do with Node not being installed in the container? Any thoughts/help is appreciated.
[SOLVED]
It turns out I was missing some commands in my
Dockerfile
to install nodejs:collectstatic
now works as expected.