eclipse less编译时错误处理

错误提示:
Cannot be launched because of an I/O exception
Cannot run program “lessc”: error=2, No such file or directory
需要修改less 编译器配置
选中eclipse explore中的less文件,右键-run configuation进入配置对话框。
重新修改options选项中的options中的LESS Command 为lessc的位置
mac下:
/usr/local/bin/lessc
windows下:
C:\Users[Yourname]\AppData\Roaming\npm\lessc.cmd

How to use it?如何使用
Once you have installed the plugin, you just need to create a file with the file extension .less in any project. This file will automatically be opened with the LESS editor.
一旦你安装了这个插件,你需要在你的工程中创建一个.less扩展名的文件,这个文件会被LESS编辑器自动打开

You may register additional file extensions for LESS stylesheets in the Eclipse Preferences (menu Window, then Preferences…), section General > Content Types.
你可以注册其他文件扩展名的的LESS样式文件,操作是Preferences->General > Content Types

You can disable some errors/warnings on a per-project warning, by editing the project properties (tab Validation > LESS.

In order to launch the LESS compiler from Eclipse, you need to create a launch configuration. For this:
less运行配置
In the menu Run, select Run Configurations…

Select LESS Compiler in the list on the left hand side of the dialog, then click on the icon to create a new launch configuration at the top of this list,

Configure the options to run the LESS compiler (in particular the LESS command if lessc is not in your system path) and check the option Use this launch configuration as default.

Once this is done, you may compile any LESS stylesheet by selecting it in the project explorer, clicking on the right button to open the contextual(上下文的) menu and selecting Run as, LESS Compiler. This will use the default launch configuration you just created. You can also create specific launch configurations for each of your stylesheet.
选中一个文件右键选中Run Configurations会弹出一个配置对话框,LESS command的值修改为你lessc所在的位置。注意要确保lessc已经安装在你的系统中

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值