Getting the Windows File Watcher to work on PHP Storm 10.0.2 Follow
I never thought this would be so difficult. What a performance. I'm just trying to get the LESS transpiler to to work. Perhaps I should use Crunch ?
Anyway - as detailed in the JetBrains tutorial, I installed nodeJS then used NPM to install the LESS transpiler. ( Command line - in 2015 - oh boy ) It has has been installed into Users/kt/AppData/Roaming/npm. [ Obviously am kt ] I didn't have any choice about this. Or maybe there a command option ? Can't find one on the PHPStorm help stuff. NPM also updatated the PATH variable. I'm presuming that the file I need to kick everything off is lessc.cmd, but I can't find this written down anywhere.
So now I go to Settings/Tools/File Watchers. There's a file watcher already there called Less. I select this, then click on the pencil to edit it. I'm trying to set the Program parameter on the Edit Watcher dialog. Click on the button ( not insert macro - the one to the left of it ). File Browser dialog opens. Go to Users/kt - and there is no folder called AppData. I can see the folder OK if I use Windows file explorer, but PHPStorm can't see it. What is this about ?
So - here's my question - if I put a copy of the npm folder somewhere where PHPStorm CANsee it and change the PATH, will it still work ?
KT
Please sign in to leave a comment.
Hi there,
Maybe yes, maybe not. But better do not do this and use the current (proper) location.
"AppData" is a hidden folder. You need to enable "Show Hidden Files and Directories" option in that Browse dialog in order to see it.
Alternatively just do not use Browse dialog and copy-paste full path to "lessc.cmd" manually into the "Program" field.
Quite opposite -- thanks God for such option -- console tools are much easier to use in automation tasks (especially when this task is just a sub-task or a greater task where different tools are used).