Less Windows Node.js Hanging

I am trying to configure Symfony2 on Windows so that I can use assetic with less.

I installed node.js for Windows (0.6.8). Then I ran npm install less --global and found less in C:\Users\Matt\AppData\Roaming\npm\node_modules

As for my Symfony setup, I have the main branch of Assetic (due to the error I read about in 1.0.2), but the standard v1.0.1 from AsseticBundle

After some work, I was able to get an example of a smaller file for rendering via: http: //localhost/app_dev.php/css/compiled-main_part_1_boilerplate_1.css

Then I switched the unlimited file, which @imports other .less files (in the same subdirectory). Whenever I try to go to this page on my local server (using this smaller configuration), it freezes and I see the command process and the node.exe process, both are executed.

The team is trying to run a script in node.js that exists in my temporary directory. I can run this file through node.js on the command line, but I cannot download it using Symfony / Assetic.

Can I use node.js, less and assetic for Windows?

Here are my relevant sections of the configuration file:

 # Assetic Configuration assetic: debug: %kernel.debug% use_controller: false bundles: [FeedStreamMainBundle] # java: /usr/bin/java filters: cssrewrite: ~ less: node: %assetic_node% node_paths: [%assetic_less_path%] yui_js: jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar" yui_css: jar: %kernel.root_dir%/java/yuicompressor-2.4.2.jar # closure: # jar: %kernel.root_dir%/java/compiler.jar 

dev config override:

 assetic: use_controller: true 

in .ini options:

 assetic_node="C:\\Program Files (x86)\\nodejs\\node" assetic_less_path="C:\\Users\\Matt\\AppData\\Roaming\\npm\\node_modules" 
+5
windows less symfony assetic
source share
3 answers

Since no one has any answers, I can only assume that very few Windows developers use LESS and node.js in Symfony2.

My solution was to use lessphp, which worked fine as soon as I hit the autoloader.

0
source share

yes, use lessphp (server side)

Symfony2.1. How to integrate lessphp assembly filter. Add the following

for your composer .json:

 "require": { ... "leafo/lessphp": "dev-master", ... } 

Run php composer.phar update

and update your config.yml

 #... assetic: #... filters: lessphp: file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php apply_to: "\.less$" 

or use less.js (client side)

 <link rel="stylesheet/less" type="text/css" href="styles.less"> <script src="less.js" type="text/javascript"></script> 
+4
source share

I used the following and it works for me. Note that this is "node.exe", not just node.

 node: "C:\\Program Files (x86)\\nodejs\\node.exe" node_paths: ["C:\\Users\\Ben\AppData\\Roaming\\npm\\node_modules"] apply_to: "\.less$" 
+3
source share

All Articles