TypeError:无法读取未定义的属性“内容”

时间:2014-12-02 15:22:21

标签: symfony less assetic

运行assetic:dump时出现此错误:

  [Assetic\Exception\FilterException]                                                             
  An error occurred while running:                                                                
  '/usr/bin/nodejs' '/tmp/assetic_lessGtKxv8'                                                     
  Error Output:                                                                                   
  /usr/local/lib/node_modules/less/lib/less/parser/parser.js:108                                  
              imports.contents[fileInfo.filename] = str;                                          
                     ^                                                                            
  TypeError: Cannot read property 'contents' of undefined                                         
      at Object.Parser.parse (/usr/local/lib/node_modules/less/lib/less/parser/parser.js:108:20)  
      at Object.<anonymous> (/tmp/assetic_lessGtKxv8:4:142)                                       
      at Module._compile (module.js:456:26)                                                       
      at Object.Module._extensions..js (module.js:474:10)                                         
      at Module.load (module.js:356:32)                                                           
      at Function.Module._load (module.js:312:12)                                                 
      at Function.Module.runMain (module.js:497:10)                                               
      at startup (node.js:119:16)                                                                 
      at node.js:902:3                                                                            
  Input:                                                                                          
  // Core variables and mixins                                                                    
  @import "variables.less";                                                                       
  @import "mixins.less";                                                                          
  // Reset                                                                                        
  @import "normalize.less";                                                                       
  @import "print.less";                                                                           
  // Core CSS                                                                                     
  @import "scaffolding.less";                                                                     
  @import "type.less";                                                                            
  @import "code.less";                                                                            
  @import "grid.less";                                                                            
  @import "tables.less";                                                                          
  @import "forms.less";                                                                           
  @import "buttons.less";                                                                         
  // Components                                                                                   
  @import "component-animations.less";                                                            
  @import "glyphicons.less";                                                                      
  @import "dropdowns.less";                                                                       
  @import "button-groups.less";                                                                   
  @import "input-groups.less";                                                                    
  @import "navs.less";                                                                            
  @import "navbar.less";                                                                          
  @import "breadcrumbs.less";                                                                     
  @import "pagination.less";                                                                      
  @import "pager.less";                                                                           
  @import "labels.less";                                                                          
  @import "badges.less";                                                                          
  @import "jumbotron.less";                                                                       
  @import "thumbnails.less";                                                                      
  @import "alerts.less";                                                                          
  @import "progress-bars.less";                                                                   
  @import "media.less";                                                                           
  @import "list-group.less";                                                                      
  @import "panels.less";                                                                          
  @import "wells.less";                                                                           
  @import "close.less";                                                                           
  // Components w/ JavaScript                                                                     
  @import "modals.less";                                                                          
  @import "tooltip.less";                                                                         
  @import "popovers.less";                                                                        
  @import "carousel.less";                                                                        
  // Utility classes                                                                              
  @import "utilities.less";                                                                       
  @import "responsive-utilities.less"; 

我少了458,assetic = dev-master和symfony 2.5。

1 个答案:

答案 0 :(得分:10)

我有同样的问题,如果您使用 Less@2.0 + 尝试降级为 Less@1.7.5

注意:注意到您说少于458 。您需要 Less compiler 节点包),而不是Linux文件阅读器。