Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you tell me how I can compile less file? on widnows #2

Open
saas786 opened this issue Jul 10, 2013 · 2 comments
Open

Can you tell me how I can compile less file? on widnows #2

saas786 opened this issue Jul 10, 2013 · 2 comments

Comments

@saas786
Copy link

saas786 commented Jul 10, 2013

Hi Wizardg,
I am using your app on my windows OS and wamp server, and I am able to make it work on my system, but I have issue with compiling less files, exec command doesn't work on my system, if I use same command on my terminal (windows command prompt), it works fine, only in php its not working, can you tell me how I can make it work on windows.

I have nodejs installed and also less is working fine

lessc %s -compress %s (works fine on command prompt with relative paths)

here is a stackexchange question I posted earlier.

http://stackoverflow.com/questions/17555100/php-compile-less-file-using-lessc-via-nodejs-on-windows-7

Thanks.

@wizardg
Copy link
Owner

wizardg commented Jul 14, 2013

Hi, Syed.

I am using Windows 7 to develop, too. I use lessc installed via nodejs and npm. It works fine.

My environment:

  • node v0.10.13
  • npm 1.3.4
  • lessc 1.3.3 (LESS Compiler) [JavaScript]

I have installed less in global.

  • npm install -g less@1.3.3

The cause I think is that lessc called from PHP is different from lessc called from command prompt, such as system environment variable issue.

Does it work if you change lessc command to absolute path? And, can you get value in $output after exec?

If you use lessc 1.4.0, lessc options are necessary.
1.4.0 Failing to compile Bootstrap? ・ Issue #1231 ・ less/less.js

@saas786
Copy link
Author

saas786 commented Jul 17, 2013

C:\Users\Syed>npm version

{ http_parser: '1.0',
node: '0.10.12',
v8: '3.14.5.9',
ares: '1.9.0-DEV',
uv: '0.10.11',
zlib: '1.2.3',
modules: '11',
openssl: '1.0.1e',
npm: '1.2.32' }

C:\Users\Syed\AppData\Roaming\npm\lessc -> C:\Users\Syed\AppData\Roaming\npm\nod
e_modules\less\bin\lessc

less@1.3.3 C:\Users\Syed\AppData\Roaming\npm\node_modules\less

@wizardg My environment: node v0.10.13 npm 1.3.4 lessc 1.3.3 (LESS Compiler) [JavaScript]

I have:
My environment:

node v0.10.12
npm 1.2.32
lessc 1.3.3 (LESS Compiler) [JavaScript] (just installed it)
@wizardg I have installed less in global. npm install -g less@1.3.3

Did same (for 1.4 and 1.3)

@wizardg The cause I think is that lessc called from PHP is different from lessc called from command prompt, such as system environment variable issue.

The issue I am seeing is php is not recognizing "lessc" as a command at all, I can execute other commands like "node --help" and in response it sends me output, and "php --help" and "npm --help" works as well but no response in case of "lessc --help"

if I execute this command directly in windows command prompt it works (which I think because of this file)

C:\Users\Syed\AppData\Roaming\npm\lessc.cmd

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\node_modules\less\bin\lessc" %*
) ELSE (
  node  "%~dp0\node_modules\less\bin\lessc" %*
)

see if you understand whats my issue.

Note: The reason I a following your pattern is nodejs lessc compiles way much faster then lessphp compiler on my machine so I can see instant preview :D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants