Search code examples
symfonyassetic

Symfony2 Assetic: Path to node executable could not be resolved


When running app/console assetic:dump, I am getting:

Path to node executable could not be resolved

What does it mean and how to fix this?

When trying to browse project via app_dev.php, I am getting an HTTP 500 errors when browser tries to download css and js files.


Solution

  • First make sure you have node installed and find the path to node. You can usually find this by using which node which will return something like /usr/local/bin/node. If it returns something like /usr/bin/which: no node in ... you need to install node.

    Next configure symfony. Open your config.yml (./app/config/config.yml) and the path to node to you assetic config, i.e.:

    # app/config/config.yml
    assetic:
        node: /usr/local/bin/node