PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

ServerGrove Blog: Error "Cannot find module 'less'" with Symfony2, Assetic and Twitter Bootstrap

Note: This article was originally published at PHPDeveloper on 20 March 2012.
PHPDeveloper

On the ServerGrove blog, there's a quick post with a handy tip for the Symfony2 + Assetic users out there - how to get it to recognize the "less" module.

Unfortunately the Symfony documentation does not provide any details on how to configure Assetic to use LESS. There is a blog post by Dustin Dobervich that gives some pointers, but after following the instructions, Assetic issued the following error: Cannot find module 'less'. We searched around without much success. After several tries, we nailed the configuration.

It's an easy two-step process: first you be sure you have "npm" (the package manager) installed on your system, then you modify your Symfony app.yml file to point to the Node modules path.