对于我的 prod 环境,我想使用如下配置的 UglifyCSS 过滤器 (config_prod.yml):
assetic:
filters:
uglifycss:
node: /usr/bin/env node
bin: /usr/local/bin/uglifycss
apply_to: "\.css$"
但每当我跑步
php app/console assetic:dump --env=prod --no-debug
我收到此错误消息:
[Assetic\Exception\FilterException]
An error occurred while running:
'/usr/local/bin/node' '/usr/bin/uglifycss' '/tmp/inputtyeA2H'
Error Output:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '/usr/bin/uglifycss'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
/usr/bin
所以很明显,尽管我将 Assetic 配置为使用不同的路径,但Assetic 正在寻找 uglifycss /usr/local/bin
。有谁知道这里发生了什么?