[英]Assetic:dump error Assetic\Filter\LessFilter
我在Windows中工作,試圖在Debian服務器上的產品中播放我的項目。 我正在使用svn。 我更改了config.yml以處理node和更少的路徑。
當我嘗試執行以下操作:服務器上的php app/console assetic:dump --env=prod
時出現錯誤: PHP Catchable fatal error: Argument 2 passed to Assetic\\Filter\\LessFilter::__construct() must be of the type array, string given, called in /var/www/ales/app/cache/prod/appProdProjectContainer.php on line 549 and defined in /var/www/ales/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php on line 54
隨我的配置:
assetic:
debug: "%kernel.debug%"
use_controller: false
bundles: ['MyAppliCoreBundle']
java: /usr/bin/java
filters:
cssrewrite: ~
cssembed:
jar: %kernel.root_dir%/resources/java/cssembed-0.4.5.jar
less:
node: /usr/lib/nodejs
node_paths: [/usr/lib/node_modules]
apply_to: "\.less$"
cssrewrite: ~
yui_css:
jar: "%kernel.root_dir%/ressources/java/yuicompressor-2.4.8.jar"
assets:
bootstrap_css:
inputs:
- %kernel.root_dir%/../vendor/twbs/bootstrap/less/bootstrap.less
filters:
- less
- cssrewrite
jquery:
inputs:
- %kernel.root_dir%/../vendor/jquery/jquery/jquery-2.1.1.js
output: js/jquery.js
當我嘗試DEV時,出現此錯誤:
22:45:00 [file+] /var/www/ales/app/../web/assetic/bootstrap_css.less
[Assetic\Exception\FilterException]
An error occurred while running:
'/usr/lib/nodejs' '/tmp/assetic_lessBjeLzE'
Error Output:
sh: 1: /usr/lib/nodejs: Permission denied
Input:
// Core variables and mixins
@import "variables.less";
@import "mixins.less";
我檢查了權限並將其設置為777 / usr / lib / nodejs,但沒有任何變化。
如果您需要更多詳細信息,請不要猶豫。
在debian上使用bootstrap 3的Symfony2。
哪個節點返回:
/usr/local/bin/node
wich nodejs返回:
/usr/bin/nodejs
並回顯$ NODE_PATH返回:
/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
非常感謝您的幫助,我正計划在本周末開始試生產。
我遇到了同樣的問題並很好地解決了問題,首先您可以嘗試使用以下配置:
less:
node: "node"
node_paths:
- "/usr/lib/node_modules"
- "%kernel.root_dir%/../../../node_modules"
如果以后出現此錯誤:找不到模塊“更少”,則必須安裝該模塊:
npm install -g less
我希望我會有所幫助!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.