自从我更新到 Fedora25 后,Assetic 给我一个 FilterException

Assetic give me an FilterException since I update to Fedora25

将我的 Fedora 24 更新到 25 后,官方 php 版本从 5.6 to 7.0. 所以我安装了旧版本以便两者都可用(通过 Remi Depo

$ php -v
PHP 7.0.13 (cli) (built: Nov 25 2016 06:03:52) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

$ php56 -v
PHP 5.6.29 (cli) (built: Dec  8 2016 07:55:50) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

我重新安装了 node、nodejs 和 less 以进行全新安装。

dnf install node nodejs
npm install -g less

但是因为我不能运行 symfony 2 assetic 命令: (运行使用 php 或 php56 不会改变输出)

$ php app/console assetic:dump
Dumping all dev assets.
Debug mode is on.

16:06:19 [file+] /var/www/project/app/../web/css/5a72185.css


  [Assetic\Exception\FilterException]                                                                                                                                                     
  An error occurred while running:                                                                                                                                                        
  'node' '/tmp/assetic_lessjBxrsP'                                                                                                                                                        
  Error Output:                                                                                                                                                                           
  NameError: #grid > .core > .span is undefined in /var/www/project/vendor/mopa/bootstrap-bundle/Mopa/Bundle/BootstrapBundle/Resources/bootstrap/less/navbar.less on line 199, column 3:  
  198 .navbar-fixed-bottom .container {                                                                                                                                                   
  199   #grid > .core > .span(@gridColumns);                                                                                                                                              
  200 }                                                                                                                                                                                   
  Input:                                                                                                                                                                                  
  /*!                                                                                                                                                                                     
   * MopaBootstrapBundle                                                                                                                                                                  
   *                                                                                                                                                                                      
   * Copyright 2011 Mohrenweiser & Partner                                                                                                                                                
   * Licensed under the Apache License v2.0                                                                                                                                               
   * http://www.apache.org/licenses/LICENSE-2.0                                                                                                                                           
   *                                                                                                                                                                                      
   * Import this file in your less files as first to be abled to access less vars from your file                                                                                          
   * OR                                                                                                                                                                                   
   * Add it to the stylesheets of assetic or                                                                                                                                              
   * Add it as described on http://www.lesscss.org with the less.js (maybe pathes must be adapted in that case)                                                                           
   *                                                                                                                                                                                      
   * Be careful when using less this way, might be most straight forward, but assetic doesnt check the included files                                                                     
   * for changes, and will only regenerate the css if it detects changes in this file!                                                                                                    
   *                                                                                                                                                                                      
   * For development it might be easier to include all you less files in the layout directly                                                                                              
   * But then assetic will compile each less file in a own compiler session so you cant mix in the less style into bootstrap, which might not be OK                                       
   */                                                                                                                                                                                     
  // Main bootstrap.less entry point                                                                                                                                                      
  @import "../../bootstrap/less/bootstrap.less";                                                                                                                                          
  // variables                                                                                                                                                                            
  @iconSpritePath:       "/bundles/mopabootstrap/img/glyphicons-halflings.png";                                                                                                           
  @iconWhiteSpritePath:  "/bundles/mopabootstrap/img/glyphicons-halflings-white.png";                                                                                                     
  // The Paginator less for MopaBootstrapBundle                                                                                                                                           
  @import "paginator.less";                                                                                                                                                               
  // The Subnav less for MopaBootstrapBundle                                                                                                                                              
  @import "subnav.less";                                                                                                                                                                  
  // Collection support for MopaBootstrapBundle                                                                                                                                           
  @import "collections.less";                                                                                                                                                             
  // Collection support for MopaBootstrapBundle                                                                                                                                           
  @import "google-maps.less";                                                                                                                                                             
  // if you have any variables.less file INCLUDE IT AFTER EVERYTHING cause responsive.less also overrides it with the one from bootstrap!!!!!                                             


assetic:dump [--forks FORKS] [--watch] [--force] [--period PERIOD] [--] [<write_to>]

为什么 assetic 命令不起作用?

Fedora 升级可能更新了您的 Less 版本,它不再适用于您的项目。

尝试安装和使用旧版本,如 1.7.5。

sudo npm install -g less@1.7.5