It does not come with the LESS compiler or anything else you need to use LESS in a project. The first time you create a file with the
less file extension PhpStorm will display the message
File watcher 'LESS' is available for this file. Description: 'Compiles .less files into .css files'. Sounds promising but it’s not going to work unless you have the LESS compiler installed, and installing it on Windows 7 or Windows 8 can be a pain.
Here are the quick steps to fast track you to running LESS in PhpStorm.
Download here: http://nodejs.org/
After it’s installed you should be able to run it from the DOS command line. Press
CTRL+C twice to exit.
Node.js comes with the
Nodes Packaged Modules tool or
npm that can be used on the command line to install LESSC.
C:\>npm install -g less
You’ll see a lot of packaging being installed. When it’s finished test that less is working.
C:\>lessc lessc: no input files usage: lessc [option option=parameter ...] <source> [destination]
Start PhpStorm and add a new watcher for LESS files from the menu
File > Settings > File Watchers. LESS is availible as a preconfigured watcher type and you only have to set the
So where is the executable for
npm by default places all packages under the current user’s hidden
AppData folder, and in a location where PhpStorm can not see it via the file browser. You should be able to enter
lessc.cmd as the program to run, but if PhpStorm complains the file doesn’t exist. You’ll have to manually type in the full path to the
On my workstation the full path was this.
Replace Mathew with your Windows login user name and enter that for the
Program: source. If for some reason you can not find
lessc.cmd, then search your hard drive for that file. This is what PhpStorm needs to execute LESS.
After creating the watcher you’ll have to restart PhpStorm. Less did not work for me until I restarted.