【发布时间】:2021-04-25 09:33:15
【问题描述】:
我正在尝试将 django-pipeline 添加到 dockerized Django 3.1 项目中。但是,当我运行 collectstatic 时,我收到以下错误:
pipeline.exceptions.CompressorError: b'/usr/bin/env: \xe2\x80\x98node\xe2\x80\x99:
No such file or directory\n'
我的settings.py 文件包括:
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',
},
},
}
我的package.json 包括:
{
...,
"dependencies": {
"sass": "^1.32.5",
"yuglify": "^2.0.0"
}
}
我还有其他使用管道但不使用 Docker 的本地 Django 项目,它们工作正常,所以我想知道这是否与容器中未安装 Node 有关?任何想法/帮助表示赞赏。
【问题讨论】:
标签: python node.js django docker django-pipeline