What is the travis-ci node binary path?

436 Views Asked by At

Context

I have a project in Symfony2 where I use the less filter in assetic. I've wrote behat tests through a travis instance, so I need to dump assets (with assetic:dump command) to run the tests.

I have installed less module in travis.yml but...

Problem:

...the assetic configuration expects to fill the node binary path.

I don't know the travis's one so I entered the default path (/usr/bin/node) :

config_test.yml

# Assetic Configuration
assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    filters:
        cssrewrite: ~
        less:
            node: "/usr/bin/node"
            node_paths:
                - "/usr/lib/node_modules"
                - "%kernel.root_dir%/../../../node_modules"
            apply_to: "\.less$"

Unfortunately, this does not work and I get this error :

  [Assetic\Exception\FilterException]                                          
  An error occurred while running:                                             
  '/usr/bin/node' '/tmp/assetic_lessP2VxsX'                                    
  Error Output:                                              
  sh: 1: /usr/bin/node: not found

I didn't found it on the documentation... does anyone already did this ?

1

There are 1 best solutions below

0
On BEST ANSWER

Actually, there is no need to specify the exact path ant the simple alias is correct here :

So my config_test.yml looks like :

# Assetic Configuration
assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    filters:
        cssrewrite: ~
        less:
            node: "node"
            node_paths:
                - "/usr/lib/node_modules"
                - "%kernel.root_dir%/../../../node_modules"
            apply_to: "\.less$"