0

I know this question had been asked a few times already, but I tried everything I found and nothing worked, so I'll ask directly

I have a symfony 2.0 project, in which I'm building a docker

But when I try to run assetic:dump, I get this error :

[RuntimeException]                                          

module.js:340                                               
    throw err;                                              
        ^                                                 
Error: Cannot find module 'less'                            
    at Function.Module._resolveFilename (module.js:338:15)  
    at Function.Module._load (module.js:280:25)             
    at Module.require (module.js:364:17)                    
    at require (module.js:380:17)                           
    at Object.<anonymous> (/tmp/assetic_lessJknvfV:1:74)    
    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)

But less is already installed, when I type which less :

/usr/bin/less

When I type /usr/bin/less it works

My parameters.ini less part :

less.node                = /usr/bin/nodejs
less.node_path           = /usr/bin/less

My assetic config in config.yml :

assetic:
debug:          %kernel.debug%
use_controller: false
filters:
    cssrewrite: ~

    less:
        node:       %less.node%
        node_paths: [%less.node_path%]
        apply_to:   "\.less$"

    yui_css:
        jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar

    yui_js:
        jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar

I'm working with php 5.6

Thanks for your time and help :)

  • My guess would be that your [`/usr/bin/less`](https://en.wikipedia.org/wiki/Less_(Unix)) is a unix command used for paging text files, similar to "more" except more powerful ("Less is more", get it? :D) [LESS](https://en.wikipedia.org/wiki/Less_(stylesheet_language)) is a stylesheet language, and the two have no connection whatsoever. What actually happens when you type "/usr/bin/less"? How do you know it works? – Matt Gibson Dec 27 '17 at 10:19
  • Well, it shows me `Missing filename ("less --help" for help)` when I type it without specifying a filename :/ I understand what you mean though, but I tried the path to the less node module in the node_modules directory, didn't work either :/ – Jérémy Lefebvre Dec 27 '17 at 14:45
  • Wow okay nevermind, I was going too deep, I just had to replace "/usr/bin/less" by "/usr/lib/node_modules"... -_- – Jérémy Lefebvre Dec 27 '17 at 14:49

0 Answers0